time: Calculate period to wait on each iteration (#237)

Computing the delay only once won't work; it has to be be done each time
to stay properly in sync.

The time widget should now reliably update at the minute.

Co-authored-by: Michael Murphy <michael@mmurphy.dev>
This commit is contained in:
Ian Douglas Scott 2024-02-27 13:51:42 -08:00 committed by GitHub
parent 43de23e94a
commit fee7eefe5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 22 deletions

View file

@ -8,8 +8,9 @@ license = "GPL-3.0-or-later"
icon-loader = { version = "0.3.6", features = ["gtk"] }
libcosmic.workspace = true
nix = "0.26.2"
chrono = { version = "0.4.23", features = ["clock"] }
chrono = { version = "0.4.34", features = ["clock"] }
once_cell = "1"
tokio = { version = "1.36.0", features = ["time"] }
tracing.workspace = true
# Application i18n