标签:date control puts seconds pre print mes code cond
code
import time import datetime t1=time.time() time.sleep(5) t2=time.time() print("相差",(datetime.datetime.fromtimestamp(t2)-datetime.datetime.fromtimestamp(t1)).seconds,"秒")
outputs
macname@MacdeMBP Desktop % python3 test.py 相差 5 秒 macname@MacdeMBP Desktop %
标签:date control puts seconds pre print mes code cond
原文地址:https://www.cnblogs.com/sea-stream/p/12851675.html