Skip to content

Commit

Permalink
improve time_left_ms
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeldmann committed Jan 11, 2023
1 parent 95f4d45 commit a28b4de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Timeout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@ uint32_t Timeout::time_left_ms(void)
if (time_over()) {
return 0;
}
int32_t ms_left = time_ms_ - (millis() - reset_time_ms_);
return ms_left > 0 ? ms_left : 0;
return time_ms_ - (uint32_t)(millis() - reset_time_ms_);
}

0 comments on commit a28b4de

Please sign in to comment.