Clock.MenuApplet: Only wake up once per second

This avoids an issue where we'd sometimes go longer than a whole second
between updates. Thanks to Roman May for the suggestion! :^)
This commit is contained in:
Andreas Kling 2019-12-29 21:17:07 +01:00
parent fed3416bd2
commit 8721d54f24
Notes: sideshowbarker 2024-07-19 10:33:46 +09:00

View file

@ -14,7 +14,7 @@ public:
{
m_time_width = Font::default_bold_font().width("2222-22-22 22:22:22");
m_timer = CTimer::construct(300, [this] {
m_timer = CTimer::construct(1000, [this] {
static time_t last_update_time;
time_t now = time(nullptr);
if (now != last_update_time) {