Open inghamn opened 2 years ago
We saved a ton of CPU by doing the clock updates only once a second, rather than every 10 milliseconds. Further improvements can be had by replacing the custom formatting code with Date().toLocaleString(). However, this would require some HTML markup changes.
On the Raspberry PI timeclocks, the webpage they load sends the CPU to 100% usage, all the time. The wastes electricty, and causes the Raspberry PI to run very hot.
The culprit is a 10ms timeout loop that is meant to update the time displayed on the webpage (every 10 milliseconds). If we don't need per-second accuracy displayed on the timeclock, we don't need this CPU consuming loop.