It's very simple, just use the time function in time. This function returns the current time by subtracting the starting time from the ending time.
from time import time
start = time()
# 中间你可以编写其它代码
end = time()
print("程序运行时间为:" + str(end-start) + "秒")
That's it for today's course. Although it is very short, I hope you can learn the essence, bye!