/timer.py

Simple timer written in Python

Primary LanguagePython

timer.py

A very simple timer written in Python. Useful for simple applications.

  1. We create an instance of the Timer class with parameters such as time unit (s or ms) and precision.
  2. The start() method starts the timer.
  3. The check() method returns the current elapsed time since the start.
  4. The stop() method stops the timer and returns the total time.
  5. The restart() method resets the timer on run.
  6. The zero() method resets all object attributes to zero.