datetime.clock
Defined in module
"datetime"from "datetime" import clockReturns CPU time used by the process in seconds
Return value
Seconds of CPU time as a float, measured from process start.
Notes
This is CPU time, not wall-clock time: it does not advance while the process is idle, for example while blocked on I/O or asleep, so it can read well behind time. Use time to measure how much real time has passed.
Example
from "datetime" import clock
// the reading itself varies, so only its type and sign are stable
let t = clock()
println("type(t) =", type(t))
println("t >= 0.0 =", t >= 0.0)Output:
type(t) = float
t >= 0.0 = trueSee also
time | Returns the current time as seconds since the Unix epoch |
| datetime | module index |