Skip to content

favoritemedium/chess-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chess Timer

The ChessTimer class provides a timer which measures elapsed time on a given task. There is no limit to the number of tasks, but only one task accumulates time at any given moment.

All times are in floating-point seconds.

Requires Python ≥ 3.3 because it uses time.monotonic().

Installation

Just download ChessTimer.py and include it in your project.

Usage

johnny = ChessTimer()
johnny.switch_to('A')

...

johnny.switch_to('B')

...

johnny.switch_to('A')

...

johnny.switch_to(7)

...

johnny.switch_to(None)
print(johnny.all_elapsed_time(reset=True))
  # e.g. {'A': 2.14158, 'B': 0.33546, 7: 1.25665}

print(johnny.all_elapsed_time())
  # {}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages