-
• #2
I know I can set a timer to go off every sixty seconds, but is there a way to start at 0 seconds past the minute? Or on exactly 0 seconds and 30 seconds past?
Clocks usually use the
setTimeout
method like this: https://github.com/espruino/BangleApps/blob/c4f9d7757912442df66b21038322ee65acf53b53/apps/waveclk/app.js#L21-L24The 60000 - (Date.now() % 60000) part returns the millis to the next minute.
-
• #3
Ah, thank you Alessandro, I hadn't seen that before but it's exactly what I need!
Hi,
I've only written one clock so far (and editing another), but it was fun! I had a a question about the best way to update the clock face:
On the pebble, there was a function
rocky.on('minutechange', function(event) {
that would fire every minute, on the minute. Is there a similar function for the bangle?I know I can set a timer to go off every sixty seconds, but is there a way to start at 0 seconds past the minute? Or on exactly 0 seconds and 30 seconds past?
Thank you.