16 lines
288 B
Python
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
|