Shortcuts

Timer

class pybind11_ke.utils.Timer[源代码]

记录多次实验的时间。

通过调用 stop() 能够返回距离上一次 stop() 调用或创建 Timer 对象时的时间间隔。

avg() 能够返回多次实验的平均时间;sum() 能够返回多次实验的总时间。

__init__()[源代码]

创建 Timer 对象。

__restart()

重启计时器。

__weakref__

list of weak references to the object (if defined)

avg() float[源代码]

返回平均时间。

返回:

平均时间

返回类型:

float

current: float

记录当前时间

last: float

记录上一次的时间

stop() float[源代码]

停止计时器并将时间记录在列表中。

返回:

返回最后一次的间隔时间。

返回类型:

float

sum() float[源代码]

返回时间总和。

返回:

时间总和。

返回类型:

float

times: list[float]

存放时间间隔的列表

Docs

Access comprehensive developer documentation for Pybind11-OpenKE

View Docs