Files
pythonprimes/timer.py
Reese Wells 47c752ff65 init
2018-07-29 17:25:09 -04:00

16 lines
288 B
Python

import time
def timing_function(prime_finder, *args):
"""
Outputs the time a function takes
to execute.
"""
def wrapper(*args):
t1 = time.time()
result = prime_finder(*args)
t2 = time.time()
return result, t2 - t1
return wrapper