Lib-Pico8 icon indicating copy to clipboard operation
Lib-Pico8 copied to clipboard

timer copes with numeric overflow?

Open gingerbeardman opened this issue 9 years ago • 4 comments

Does timer cope with numeric overflow?

gingerbeardman avatar Jun 01 '16 11:06 gingerbeardman

No, it doesn't. In fact, time() only goes up to a much smaller number than we originally thought; we thought it would go up to the max 8-bit int, which would overflow at around 9 hours, but it actually overflows at a much smaller value, rolling back to 0 after less than 15 minutes. The timers are going to have to be reworked to use the update callback instead of time() until if/when Zep implements a proper timer API.

clowerweb avatar Jun 01 '16 12:06 clowerweb

@clowerweb is this still an outstanding issue?

p.s. perhaps adding library authors as collaborators would help them to see and respond to issues like this one when they crop up 😄

benwiley4000 avatar Aug 07 '17 01:08 benwiley4000

Do we know that the update callback reliably gets called 30/60/whatever times per second (or at least approaches that ratio at the limit)? My main concern about using the update callback rather than time() would be that the time displayed onscreen might not be accurate over time.

Also now seeing that time() was removed since I wrote this util so it's gonna need some updating anyway. Not sure what the replacement is meant to be.

benwiley4000 avatar Aug 07 '17 01:08 benwiley4000

time() was removed but it's still there and can by used (last time I checked). Deprecated is probably what Zep meant when he wrote that changelog.

gingerbeardman avatar Aug 07 '17 08:08 gingerbeardman