-->
Page 1 of 1

How Timer() function works ?

PostPosted: Thu Jan 10, 2019 7:41 am
by Scugnizzo
Hi all,
I 've a question about Timer() function. All knows that this useful function runs a branch every x milliseconds as specified when programming.
But what happens if the branch itself contains a delay() function with a value greater than the Timer() function ??
In other words, what happens in this example ??

Code: Select allTimer 1000, [test]
wait

[test]
delay 1500
Print "Hello World"
wait


I think that the Timer() function starts another cycle only when the branch is completely performed. Is it correct ??
Thank you

Re: How Timer() function works ?

PostPosted: Sat Jan 12, 2019 10:31 am
by Oldbod
I don't know, and the screen on my phone is too small to wade through a lot of code. But you have written a test program that looks like it would answer the question pretty quickly, so....

Normally I would expect entry to a timer or soft interrupt handler to either disable or allow options for dealing with further interrupts. Otherwise you might get a huge stack.. essentially though you need to write your code with awareness of what might happen allowing for how long stuff takes, which I guess is why you asked the question...