python monotonic_ns()方法

monotonic_ns()方法

python time模块monotonic_ns()方法也可以用来获取单调时钟值,与monotonic()不同的地方是,monotonic_ns()是以整型数值来返回的,而不是float浮点数,且单位是纳秒nanoseconds。

语法

monotonic_ns() -> int

python源码中对该方法的介绍:

    Monotonic clock, cannot go backward, as nanoseconds.

参数

无。

返回值

以纳秒nanoseconds表示的单调时钟值。python int整型数值。


monotonic_ns()实例代码

运行代码的python版本为3.7.6:

>>> import time
>>> time.monotonic_ns()
129110046159

全栈后端 / Python库 :









Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.