Reducing CPU usage

Blitz3D Forums/Blitz3D Programming/Reducing CPU usage

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

First I better say that I didnt make this discovery,
It was posted here elsewhere but I thought that it would
very important or interesting to some people.

Adding this routine reduced CPU usage by 5%-15% instead of
full-on 100% even if your code is just delaying till the
next frame inside a timing loop.


New code used to keep my emulator at 60-FPS:

timer#=MilliSecs()
f=Int(timer#-oldtimer#)
f=16-f
If f>0 Then Delay f
oldtimer#=MilliSecs()


RESULTS:

1.lower CPU cooling fan speed and therefore less noise.
2.lower power consumption for notebooks.
3.lower CPU core temperatures.