mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 19:50:22 +00:00
Timer's were not firing at the right time if they were started shortly after the program started, instead they would fire at twice the interval time (and then work correctly after that). The issue was a mistaken assumption about `time_now`, with the idea that if `last_time == 0` then `time_now` will be large enough such that the interval check will pass. This is wrong because in most cases `time_now` starts at zero at program start, so when `last_time == 0` it will take one full interval of the timer before `time_now` is large enough for the interval check to pass (at which point the timer is initialized and runs normally). This simply refactors the timer logic so that `last_time == 0` is checked first, rather than if the interval has expired. This doesn't change how the normal logic works, but ensures that the value of `time_now` does not matter for initializing a timer. Fixes: #273 |
||
---|---|---|
.. | ||
c | ||
source | ||
support | ||
temp | ||
clean.bat | ||
version.txt |