Ok i know im being Finiky here but how the frik do i do this!!

I can happily limit fps at 50 fps since I can wait 1000ms/50=20ms
with Sleep command or GetTickCount method but how do i pass
16.6666666 to Sleep for example. Since it wont accept floating point numbers!

Is there another way of performing this time test i havent heard of.....

tia

Posted on 2006-11-06 09:23:55 by Nice Eddie
Hey, that's weird... I was looking for a thread by Homer or Biterider a little while ago where they did discuss on how to limit fps a certain way. If I remember well they said something about on how to calculate on how long the part of code lasts which you'd like to repeat x amount of times and then do the fps calculations based on that number.

I hope them boys know which thread I mean and help you out ;) As for myself I'd like to forward that thread to my email for further reference.




I would do a QueryPerformanceCounter / QueryPerformanceFrequency to get the Ticks Per Second. Divide TicksPerSec by frames per seconds wanted and every x amount let do an itineration of what you'd like to display.

/edit: corrected a little error
Posted on 2006-11-06 09:33:21 by JimmyClif

I would do a QueryPerformanceCounter / QueryPerformanceFrequency to get the Ticks Per Second. Divide TicksPerSec by frames per seconds wanted and every x amount let do an itineration of what you'd like to display.

Yeah,i read on another page that said this wasnt the best way. That a combination of sleep(0) and get tick count could be used so not to hammer cpu to 100% usage constantly... Ill post it when i find it again.(still recovering from the gret hard drive crash of  '06 :lol:)
Posted on 2006-11-06 09:51:14 by Nice Eddie
Take a look at this post: http://www.asmcommunity.net/board/index.php?topic=25102.0

Regards,

Biterider
Posted on 2006-11-06 09:53:05 by Biterider
That was the thread I was referring too :) Thanks.
Posted on 2006-11-06 09:59:28 by JimmyClif