python time库有哪些时钟

2025-12-01 0 40,441

时钟说明

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电脑。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:以上部本文内容由互联网用户自发贡献,本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。投诉邮箱:3758217903@qq.com

ZhiUp资源网 python基础 python time库有哪些时钟 https://www.zhiup.top/1540.html

相关