Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytime

A lightweight and easy-to-use library that facilitates runtime logging.

Retrieve the runtime of a chosen code chunk:

from pytime import inline_runtime, time

t1 = time()
... # Do stuff
rtime = inline_runtime(t1)
print(rtime)

Use the func_runtime decorator so that a function call always logs the runtime:

from pytime import func_runtime
from time import sleep

@func_runtime(unit='ms') # Default unit is 'ms', accepts 's' for seconds
def my_func():
    sleep(1)

my_func()
Terminal output: 'Runtime ms: 1006.91'

About

A lightweight and easy-to-use library that facilitates runtime logging.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages