diff --git a/count_timer/count_timer.py b/count_timer/count_timer.py index 1330692..c0016a5 100644 --- a/count_timer/count_timer.py +++ b/count_timer/count_timer.py @@ -17,6 +17,8 @@ class CountTimer: start(): start the timer pause(): pause the timer resume(): resume the timer + set_minutes_start_time(minutes): set the start time manually in minutes + set_seconds_start_time(seconds): set the start time manually in seconds reset(): reset the timer to default (duration 0/paused/not started) Properties: @@ -63,6 +65,18 @@ def resume(self): self._time_started = self._time_started + pause_duration self._paused = False + def set_minutes_start_time(self, minutes): + """Set the start time manually in minutes.""" + self._time_started = time.time() - (minutes * 60) + self._time_paused = time.time() + self._paused = True + + def set_seconds_start_time(self, seconds): + """Set the start time manually in minutes.""" + self._time_started = time.time() - seconds + self._time_paused = time.time() + self._paused = True + def _get(self) -> float: """Time in sec since timer was started, minus any time paused.""" if not self._time_started: