๐
Work with time
We use time module when we want work with time in our program
python
import timeprint(time.time()) # return current time in second
Output
1597570045.7422454
Human readable
python
import timeprint(time.ctime(time.time())) # return current time in second
Output
Sun Aug 16 13:57:43 2020
We can get execution time with time module
python
import timedef send_mail():for i in range(1000)start = time.time()send_mail()finish = time.time()print("Duration: ", finish - start)
