In the following code sample, I have a DO...LOOP that simply prints out how many seconds have elapsed once per second.
Before that loop is started, I seup a timer to run a subroutine every 5 seconds. That subroutine simply prints out how many times it has been run.
What's odd is that the first timer event does not happen after 5 seconds, it happens after 10 seconds. After the first run it correctly runs every 5 seconds.
If you change the interval, the same thing still happens. For example, if I set the timer to 10 seconds, the first execution of the timed event happens after 20 seconds, not 10 seconds.
Is this expected behavior for some reason?
Test scenario: QB 1.51 (April 9, 2021 Dev Build) on Win 10 20H2
Sample code:
x = 0
y = 0
t1 = _FreeTimer
On Timer(t1, 5) GoSub DoTimedStuff
Timer(t1) On
Do
_Limit 1
x = x + 1
Print "Seconds elapsed:"; x
Loop
DoTimedStuff:
y = y + 1
Print "Timer ticks:"; y
Return