好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

python time库有哪些时钟

时钟说明

1、monotonic测量长时间运行过程需要时间。

因为即使系统时间发生变化,也能保证钟不会逆转。

2、perf_counter允许访问最高可用分辨率的时钟。

使短时间测量更加正确。

3、process_time返回处理器时间和系统时间的组合结果。

4、time回到纪元以来的秒数。

UNIX系统从1970年1月1日00:00开始计算。

实例

import time
 
print(time.monotonic())
print(time.monotonic_ns())
print(time.perf_counter())
print(time.perf_counter_ns())
print(time.process_time())
print(time.process_time_ns())
print(time.time())
print(time.time_ns())

以上就是python time库时钟的介绍,希望对大家有所帮助。 更多Python学习指路: python基础教程

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

查看更多关于python time库有哪些时钟的详细内容...

  阅读:17次