MCPcopy Index your code
hub / github.com/ipython/ipython / clock

Function clock

IPython/utils/timing.py:52–60  ·  view source on GitHub ↗

clock() -> floating point number Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of the process. This is done via a call to resource.getrusage, so it avoids the wraparound problems in time.clock().

()

Source from the content-addressed store, hash-verified

50 return resource.getrusage(resource.RUSAGE_SELF)[1]
51
52 def clock():
53 """clock() -> floating point number
54
55 Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of
56 the process. This is done via a call to resource.getrusage, so it
57 avoids the wraparound problems in time.clock()."""
58
59 u,s = resource.getrusage(resource.RUSAGE_SELF)[:2]
60 return u+s
61
62 def clock2() -> tuple[float, float]:
63 """clock2() -> (t_user,t_system)

Callers 6

timeitMethod · 0.90
timeMethod · 0.90
timings_outFunction · 0.85
inputhookFunction · 0.85
inputhook_wx3Function · 0.85
inputhookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…