Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions codetiming/_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def __post_init__(self) -> None:
def start(self) -> None:
"""Start a new timer"""
if self._start_time is not None:
raise TimerError(f"Timer is running. Use .stop() to stop it")
raise TimerError("Timer is running. Use .stop() to stop it")

self._start_time = time.perf_counter()

def stop(self) -> float:
"""Stop the timer, and report the elapsed time"""
if self._start_time is None:
raise TimerError(f"Timer is not running. Use .start() to start it")
raise TimerError("Timer is not running. Use .start() to start it")

# Calculate elapsed time
self.last = time.perf_counter() - self._start_time
Expand Down