ATLAS Offline Software
Functions
python.rtime Namespace Reference

Functions

def rtime (fn, *args, **kw)
 

Function Documentation

◆ rtime()

def python.rtime.rtime (   fn,
args,
**  kw 
)
Call FN with the additional arguments passed in.
Print a report of the CPU time taken.

Definition at line 14 of file rtime.py.

14 def rtime (fn, *args, **kw):
15  """Call FN with the additional arguments passed in.
16 Print a report of the CPU time taken.
17 """
18  ru0 = resource.getrusage (resource.RUSAGE_SELF)
19  ret = None
20  try:
21  ret = fn (*args, **kw)
22  finally:
23  ru1 = resource.getrusage (resource.RUSAGE_SELF)
24  print ("utime: %f, stime: %f" % (ru1.ru_utime-ru0.ru_utime,
25  ru1.ru_stime-ru0.ru_stime))
26  return ret
27 
28 
python.rtime.rtime
def rtime(fn, *args, **kw)
Definition: rtime.py:14