MCPcopy Create free account
hub / github.com/ipython/ipython / clock

Function clock

IPython/utils/timing.py:44–52  ·  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

42 return resource.getrusage(resource.RUSAGE_SELF)[1]
43
44 def clock():
45 """clock() -> floating point number
46
47 Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of
48 the process. This is done via a call to resource.getrusage, so it
49 avoids the wraparound problems in time.clock()."""
50
51 u,s = resource.getrusage(resource.RUSAGE_SELF)[:2]
52 return u+s
53
54 def clock2():
55 """clock2() -> (t_user,t_system)

Callers 9

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

Calls

no outgoing calls

Tested by

no test coverage detected