Skip to content

A very simple stopwatch script, for command line or Python use.

License

Notifications You must be signed in to change notification settings

Burrito-Bazooka/monowatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

monowatch

A very simple stopwatch script, for command line or Python use.

CLI usage:

$ python3 ./monowatch.py
0:00:08.078806

Using python2 or python is also fine. Pause with ^C (Ctrl+C on most systems, or whatever will trigger KeyboardInterrupt).

0:00:12.42306^C
Stopwatch paused.  KeyboardInterrupt (^C) again to stop. Input numbers to offset the stopwatch ('-10' for 10 seconds subtracted, '10' for 10 seconds added). Input 'u' to resume as if never paused. Press Return to resume stopwatch: 

Python usage:

>>> import monowatch
>>> monowatch.monowatch()
0:00:01.169368

Everything else is the same as CLI usage, shown above. Here, we trigger KeyboardInterrupt twice:

0:00:04.817535^C
Stopwatch paused.  KeyboardInterrupt (^C) again to stop. Input numbers to offset the stopwatch ('-10' for 10 seconds subtracted, '10' for 10 seconds added). Input 'u' to resume as if never paused. Press Return to resume stopwatch: 

datetime.timedelta(0, 4, 863235)
>>>

When the function is done (stopped without errors), it returns a datetime.timedelta for the time it ran.

About

A very simple stopwatch script, for command line or Python use.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages