From 8baae11989b413d944662c8321fdb20508b01072 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 24 Aug 2021 14:38:42 +0200 Subject: [PATCH] [Debug] fix nanos in log timestamp The timestamp consists of . but the calculation of the nanos in the current minute was broken. A minute are 60 * 10^9 nanoseconds and not 10^9. --- emper/Debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emper/Debug.cpp b/emper/Debug.cpp index 93aaa243..953fef6f 100644 --- a/emper/Debug.cpp +++ b/emper/Debug.cpp @@ -33,7 +33,7 @@ void emper_add_timestamp_to(std::ostringstream& logMessage) { auto time_since_epoch = now_nanos.time_since_epoch(); long time_since_epoch_long = time_since_epoch.count(); - long remaining_nanos = time_since_epoch_long % 1000000000; + long remaining_nanos = time_since_epoch_long % 60000000000; logMessage << remaining_nanos; } -- GitLab