Skip to content

wrwrwr/cmtimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmtimer

Measures the execution time of a block of code. Uses perf_counter for the measurement. Behaves like a float (seconds) when printed or used within an arithmetic context.

Example

from cmtimer import Timer

with Timer() as time:
    # Three hours too soon or a minute too late?

print(f"Time taken: {time:.2f} s")

Installation

pip3 install cmtimer

About

A simple context manager timing utility.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages