Hertz to Milli
BlitzMax Forums/BlitzMax Beginners Area/Hertz to Milli
| ||
If I create A timer with Hertz = 3 (For Example) Does the timer emit 3 Times a second or every 333 Milliseconds? |
| ||
both. Every 333. |
| ||
@Angel Every 333 is not the same as 3 hertz, after a day 3 Hertz would have Emitted 259,200 times and every 333 milli would have emited 259,459 times. I know one day seems a long time, but the difference obviosly depends on the Frequency. And would be noticable sooner at higher frquencies. |
| ||
Then synchronize it with your display Flip() |
| ||
@ Angel. Maybe I want to sync my display to this timer Its a simple question, does A Timer emit at hertz times a second or at 1000/Hertz Milli. Then I can adust the Fuctions acordingly. Its not important which one it is |
| ||
The source calls the function timeSetEvent( 1000.0/hertz,0,timerProc,(DWORD)timer,TIME_PERIODIC ); So it looks like it's doing 1000/hertz milliseconds, instead of an actual 3 hertz. |
| ||
It would seem that way. But if you where going to call a function that Took your float and divided 1000.0 by it. Would you bother or would you make the timer Function CreateTimer:TTimer( MilliWait,event:TEvent=Null ) And the source call timeSetEvent( MilliWait,0,timerProc,(DWORD)timer,TIME_PERIODIC ); So the fact that I wouldnt bother if it wasnt going to really be in hertz and that 1000.0/Hertz returns a float, tend to imply that maybe It really is emit at hertz. So, can someone who knows the answer please say. |
| ||
MMRESULT timeSetEvent( UINT uDelay, UINT uResolution, LPTIMECALLBACK fptc, DWORD dwUser, UINT fuEvent ); ... uDelay [in] Event delay, in milliseconds. If this value is not in the range of the minimum and maximum event delays supported by the timer, the function returns an error. From the Microsoft website. The first parameter is an unsigned integer (UINT). Even though 1000.0/hertz returns a float, it'll be converted to an Int before being sent to the function. |
| ||
SO this Begs the question Why BRL Changed it to Hertz. It not like we couldnt understand, Function CreateTimer:TTimer( MilliWait,event:TEvent=Null ) But Thank you For looking it up for me :) XXX |