nowtest=function()
for i=1,5 do
print(tmr.now())
tmr.delay(1000000)
end
end
timetest=function()
for i=1,5 do
print(tmr.time())
tmr.delay(1000000)
end
end
605053390 606055199 607056705 608058206 609059708
but "timetest" prints the same number on each iteration of the for..end loop, although each time you run the function it updates to the latest time. e.g.
> timetest() --1685 1685 1685 1685 1685
> timetest() --1691 1691 1691 1691 1691
The definition for tmr.time) is "return rtc time since start up in second, uint31 form." whereas tmr.now is "return the current value of system counter: uint31, us."
Is this right? Or is it a bug? If not a bug perhaps someone could explain the difference in behaviour.