https://github.com/zonca/timemonitor
https://github.com/zonca/timemonitor
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zonca/timemonitor
- Owner: zonca
- Created: 2013-03-14T22:16:55.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-14T22:31:15.000Z (over 13 years ago)
- Last Synced: 2025-03-02T22:29:24.349Z (over 1 year ago)
- Language: Python
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Python Time Monitor
===================
Create several timers, increment them independently
and then print a summary.
Example:
from time import sleep
import timemonitor as tm
with tm.TimeMonitor("sleep1"):
print "Monitor sleep1"
sleep(1)
print "Exit from with stops the timer"
print "Creating another monitor with the same name increments it again"
with tm.TimeMonitor("sleep1"):
print "Monitor sleep1"
sleep(1)
print "Second timer"
with tm.TimeMonitor("sleep2"):
print "Monitor sleep2"
sleep(1)
print tm.summarize()
Time Monitor
sleep1 : 2.003 s
sleep2 : 1.001 s