time built-in variable - variables copy or reference
Posted: 03 Oct 2017 21:05
Hi!
I'm trying to deal with time for some applications: send a ping to a software every second, make some object blink. I tried something like that: maybe it's my arduino reflex...
but I noticed timeA and time are exactly the same, and (time - timeA) is alway 0, which means it use time by reference and not by copy.
How can I save 'time' value?
Or is there another way to manage time?
I'm trying to deal with time for some applications: send a ping to a software every second, make some object blink. I tried something like that:
Code: Select all
decl timeA = floor(time) ;
while ( (floor(time)-timeA) < 1 ) { } //which should wait for 1sec
but I noticed timeA and time are exactly the same, and (time - timeA) is alway 0, which means it use time by reference and not by copy.
How can I save 'time' value?
Or is there another way to manage time?