diff --git a/Time.cpp b/Time.cpp index 4cb01e7..b12baec 100644 --- a/Time.cpp +++ b/Time.cpp @@ -248,7 +248,9 @@ time_t sysUnsyncedTime = 0; // the time sysTime unadjusted by sync time_t now() { - while (millis() - prevMillis >= 1000){ + // calculate number of seconds passed since last call to now() + while (millis() - prevMillis >= 1000) { + // millis() and prevMillis are both unsigned ints thus the subtraction will always be the absolute value of the difference sysTime++; prevMillis += 1000; #ifdef TIME_DRIFT_INFO