Add millis helper macros

This commit is contained in:
Scott Lahteine
2020-04-03 19:49:45 -05:00
parent 723d4d6f61
commit 0e06aaa2bc
10 changed files with 26 additions and 23 deletions

View File

@ -106,8 +106,7 @@ void Stopwatch::reset() {
}
millis_t Stopwatch::duration() {
return ((isRunning() ? millis() : stopTimestamp)
- startTimestamp) / 1000UL + accumulator;
return accumulator + MS_TO_SEC((isRunning() ? millis() : stopTimestamp) - startTimestamp);
}
#if ENABLED(DEBUG_STOPWATCH)