To measure execution time of code

 try:

import timeit

mysetup = "from math import sqrt"

mycode='''[x*x for x in range(1,100)]'''

t=timeit.timeit(setup = mysetup,stmt = mycode)

print("time taken in min {} Seconds".format(t))

except Exception as e:

print(e)