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 15 of file rtime.py.

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