3 from AthenaCommon
import Logging
4 from ..utility
import RepeatingTimer
6 from functools
import wraps
9 logger = Logging.logging.getLogger(
"PowhegControl")
13 """! Decorator to output function execution time.
15 @param name Name of the process being timed.
17 @author James Robinson <james.robinson@cern.ch>
21 def wrapped_f(*args, **kwargs):
22 start_time = datetime.datetime.now()
23 logger.info(
"=> Preparing to run {} <=".
format(name))
24 result = func(*args, **kwargs)
25 logger.info(
"=> Running {} took {} <=".
format(name, RepeatingTimer.readable_duration(datetime.datetime.now() - start_time)))