1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 19:50:22 +00:00
QB64-PE/internal
Matthew Kilgore 924472f5d6 Fix timers not firing at the start of the program
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
2023-02-12 21:27:25 -05:00
..
c Fix timers not firing at the start of the program 2023-02-12 21:27:25 -05:00
source Automatic update of ./internal/source 2023-02-12 23:39:33 +00:00
support Add initial MIDI language support 2022-09-04 23:35:14 -04:00
temp Corrected OSX setup script to use OSX folder instead of Linux one. 2015-12-14 11:17:09 +11:00
clean.bat Step 10: Update remaining stuff 2022-08-12 02:54:12 +02:00
version.txt Supply a default version label when no version has been calculated 2022-05-20 16:57:45 -04:00