Skip to main content

A very simple python module for measuring time.

Project description

A very simple python module for measuring time. Github:


You can use lauda StopWatch to measure a portion of code

from lauda import StopWatch

watch = StopWatch()
for i in range(10000000):
print ('Time spent in range {0}'.format(watch.elapsed_time))

If you want to measure an entire function execution, you can decorate it using the stopwatch decorator

from lauda import stopwatch

def awesome_mul(a, b):
    return a * b

By default stopwatch decorator will print the time spent inside the decorated function, if you want more control you can pass to your decorator a callback that will receive a StopWatch instance and the decorated function.

from lauda import stopwatch

def stopwatch_sum_cb(watch, function):
    print ('Time spent {0}'.format(watch.elapsed_time))

def awesome_sum(a, b):
    return a + b

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lauda-1.0.0.tar.gz (1.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page