dmorrill10 / simple_pytimer

Simple timer code to record and log execution times of Python code in a pythonic way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Pytimer

Simple timer classes to record and log execution times of Python code in a pythonic way.

Usage

timer = Timer('long running process')
with timer:
  # do computations...
print(timer)

Example

timer = Timer('adding up a bunch of the numbers')
with timer:
  s = sum(range(10000000))
print(timer)  # "adding up a bunch of the numbers" block took 287.7 ms

About

Simple timer code to record and log execution times of Python code in a pythonic way.

License:MIT License


Languages

Language:Python 73.9%Language:Makefile 26.1%