当前位置: 首页 > 图灵资讯 > 行业资讯> python time库有哪些时钟

python time库有哪些时钟

发布时间:2024-07-25 20:19:06

时钟说明

1、长时间测量monotonic需要时间。

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

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

使短时间测量更加正确。

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

4、回到时代以来,time的秒数。

197年1月1日,UNIX系统00:00开始计算。

实例

importtime

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 图书馆时钟的介绍,希望对大家有所帮助。更多Python学习指导:python基础教程

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

相关文章

python3兼容python2吗

python3兼容python2吗

2025-05-09
python3 whl怎么安装

python3 whl怎么安装

2025-05-09
python 字典怎么提取value

python 字典怎么提取value

2025-05-09
python 怎样计算字符串的长度

python 怎样计算字符串的长度

2025-05-09
python 怎么样反向输出字符串

python 怎么样反向输出字符串

2025-05-09
python 怎么判断字符串开头

python 怎么判断字符串开头

2025-05-09