''' time_high_resolution_counter.py
measure elapsed time of a Python calculation
time.perf_counter() is new in Python 3.3
'''

import time

# returned value is in fractional seconds
start = time.perf_counter()

# let's time this calculation
y = 2**0.5

end = time.perf_counter()

elapsed = end - start
print("elapsed time = {:.12f} seconds".format(elapsed))

''' result (on an intel core i5 computer) ...
elapsed time = 0.000000410520 seconds
'''