diff options
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp index bc765f21..22b3469b 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp | |||
| @@ -58,6 +58,8 @@ void Chrono::setTime(const std::chrono::time_point<std::chrono::system_clock>& t | |||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | void Chrono::schedule(const std::chrono::time_point<std::chrono::system_clock>& targetTime) { | 60 | void Chrono::schedule(const std::chrono::time_point<std::chrono::system_clock>& targetTime) { |
| 61 | using namespace std::chrono_literals; | ||
| 62 | |||
| 61 | auto currentTime = std::chrono::system_clock::now(); | 63 | auto currentTime = std::chrono::system_clock::now(); |
| 62 | auto offset = std::chrono::duration_cast<std::chrono::milliseconds>(targetTime - currentTime); | 64 | auto offset = std::chrono::duration_cast<std::chrono::milliseconds>(targetTime - currentTime); |
| 63 | auto nextTime = abs(offset) < 500ms ? targetTime : currentTime; | 65 | auto nextTime = abs(offset) < 500ms ? targetTime : currentTime; |
