Python Time Elapsed

Snippets to calculate time elapsed in python.

import time

start = time.time()
#rest of the code

end = time.time()

timeElapsed = end - start

Python 3:

import time

start = time.process_time()
#rest of the code

end = time.process_time()
timeElapsed = end - start