您现在的位置是:课程教程文章

python time库有哪些时钟

2023-12-14 21:09课程教程文章 人已围观

时钟说明

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库有哪些时钟

上一篇:python time.ctime()如何做时间加减法

下一篇:没有了

站点信息

  • 文章统计篇文章