aboutsummaryrefslogtreecommitdiff
path: root/src/ClockTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClockTool.cc')
-rw-r--r--src/ClockTool.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index 3591f4f..b4792fe 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -70,12 +70,13 @@ int showSeconds(const std::string& fmt_string) {
70 70
71uint64_t calcNextTimeout(const std::string& fmt_string) { 71uint64_t calcNextTimeout(const std::string& fmt_string) {
72 72
73 if (showSeconds(fmt_string)) { // microseconds till next full second 73 uint64_t now = FbTk::FbTime::system();
74 return FbTk::FbTime::remainingNext(FbTk::FbTime::IN_SECONDS); 74 uint64_t unit = FbTk::FbTime::IN_SECONDS;
75 if (!showSeconds(fmt_string)) { // microseconds till next full minute
76 unit *= 60L;
75 } 77 }
76 78
77 // microseconds until next full minute 79 return FbTk::FbTime::remainingNext(now, unit);
78 return FbTk::FbTime::remainingNext(60L * FbTk::FbTime::IN_SECONDS);
79} 80}
80 81
81 82