HP Forums

Full Version: bugs about TICKS function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I found that the system tick of HP Prime runs backwards 10ms sometimes, for example:
<code>
EXPORT main()
BEGIN
LOCAL lt:=TICKS(),tt;
WHILE 1 DO
tt:=TICKS();
IF tt<lt THEN
PRINT(lt+" "+tt);
END;
lt:=tt;
END;
END;
</code>
Then I get lots of tt=lt-10.
(05-04-2018 05:10 AM)wangchong01 Wrote: [ -> ]Hello,
I found that the system tick of HP Prime runs backwards 10ms sometimes, for example:
<code>
EXPORT main()
BEGIN
LOCAL lt:=TICKS(),tt;
WHILE 1 DO
tt:=TICKS();
IF tt<lt THEN
PRINT(lt+" "+tt);
END;
lt:=tt;
END;
END;
</code>
Then I get lots of tt=lt-10.

Congratulations! You've built a time machine (albeit for very small jumps)
Interesting: When replicating the issue I found the 10 ms jumps but only in cases when times were multiples of 10 ms. That is, lt = XXX90 and tt = XXX80, BUT NOT lt = XXX93 and tt = XXX83. A piece of the puzzle perhaps.
Reference URL's