Strange Timer Behavior

BlitzMax Forums/BlitzMax Programming/Strange Timer Behavior

Chapman7(Posted 2016) [#1]


I cut out the ball bouncing crap so you guys could run the code easily. When I create a timer with 600 hertz, the FPS is 1000ish and when I create one with 500 hertz, the FPS is 500...

I don't understand what is going on. Ive already rebuilt all my modules


Derron(Posted 2016) [#2]
That 500 hertz is individual to your computer...

"print" is rather slow ... it additionally slows down your "fast as possible"-tests.



Like explained in the other thread your problem is surely this: the duration of a "wait timer" might lead to clashes with your accumulator.
-> There is not enough time for both, logic and renders with your forces "time slots". So they stumble over each other leading to your FPS cut.


Also there is no reason to disable what I added to your code before: it is there to return "better" FPS/UPS-numbers. The ones you see now are just incorrect (as they are numbers based on 1.x seconds instead of 1.0).


bye
Ron


Chapman7(Posted 2016) [#3]
Thanks for replying Derron. I just went with the old template to figure out what was wrong with WaitTimer, I am still using your fix with the main thing.

I feel like the 500 hertz thing is just my pc... not sure whats causing it but certain builds produce different results with the exact same code and it's really aggravating.

As for the "time slots" even if they do stumble over each other, how is the WaitTimer locked at 600 but allowing the code to execute faster? (1000 frames per second)




Derron(Posted 2016) [#4]
I assume that the problem is only apparent if waittimer "steals" too much time.

Rounding issues might happen too.
Like said...create a logger (do not use "print" in the loop) and before exiting print out the results.


Bye
Ron