The Python time module provides various functions to work with time-related tasks, such as measuring time intervals, formatting time, and converting between different time representations.

import time
# Unix time[a] is a date and time representation 
# widely used in computing. 
# It measures time by the number of non-leap seconds 
# that have elapsed since 00:00:00 UTC on 1 January 1970
start = time.time()
print(start)
time.sleep(2)
finish = time.time()
print(finish)
elap = finish - start
print(round(elap, 2))

RELATED ARTICLES