Source code for fmeTestSupport.TimeMeasurement
# Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
# **InsertLicense** code author="Lennart Tautz"
from timeit import default_timer as get_time
[docs]def measureElapsedTime(fct, *args, **kwargs):
"""
Measure the time the given function runs when called.
All additional arguments are passed to the function.
:return: Duration of the call in seconds.
"""
startTime_s = get_time()
fct(*args, **kwargs)
endTime_s = get_time()
return endTime_s - startTime_s