11 Use of time library for python to obtain system time
Get Time
import time
time.time() #获取从1970.1.1 0:00到现在有多少秒, 是一个浮点数
time.ctime() 这个函数可以获取一个易于读取的时间格式,格式为字符串格式
time.gmtime() 返回计算机程序可处理的时间格式,struct_time格式,是一个结构体
Time formatting
The strptime() function and strtime() function are complementary, he turns a string of characters into time
Program timing
Measuring time perf_counter()
produces time sleep()
Note the time difference calculated here