time.perf_counter()
,返回性能计数器的值,包括睡眠期间(即cpu空闲)经过的时间(可用于计算程序运行时长,cpu级别,比time.time()
精度更高)time.process_time()
,返回当前进程的系统和用户CPU时间总和的值,不包括睡眠期间(即cpu空闲)经过的时间(可用于计算程序cpu使用时长)time.clock()
,在windows下相当于perf_counter
,在linux下相当于process_time
(python3.3后废弃)
python time模块下的clock、perf_counter、process_time函数
最新推荐文章于 2022-06-14 16:35:45 发布