Sorry - maybe I wasn't clear - what I mean is, in order of power usage:
Update every minute - by far the best battery life
Update every second, but only update the area where the seconds text is
Update every second, but update the whole screen - by far the worst
Updating every second will still hurt battery over updating minutes, but it's significantly better than the whole screen. I know some watch screens can take almost a second to update, so in that case the CPU is occupied pretty much all the time.
But for example this code, tried just now, takes around 3.5ms, so isn't going to be so painful at all:
function onSecond() {
var t = getTime();
var d = new Date();
g.reset().clearRect(0,24,100,48).setFont("6x8:3").drawString(
d.getSeconds().toString().padStart(2,0),0,24);
d.getSeconds();
g.flip(); // just to ensure we include the screen flip in our time estimate - not needed
print(getTime()-t);
}
setInterval(onSecond,1000);
By contrast Anton Clock plus redraws everything and when seconds rendering is enabled it takes around 175ms every second, so obviously is going to be terrible!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sorry - maybe I wasn't clear - what I mean is, in order of power usage:
Updating every second will still hurt battery over updating minutes, but it's significantly better than the whole screen. I know some watch screens can take almost a second to update, so in that case the CPU is occupied pretty much all the time.
But for example this code, tried just now, takes around 3.5ms, so isn't going to be so painful at all:
By contrast Anton Clock plus redraws everything and when seconds rendering is enabled it takes around 175ms every second, so obviously is going to be terrible!