def timing(function):
 @wraps(function)
 def wrapped(*args, **kwargs):
  start_time = time.time()
  ret = function(*args, **salt.utils.clean_kwargs(**kwargs))
  end_time = time.time()
  if function.__module__.startswith('salt.loaded.int.'):
   mod_name = function.__module__[16:]
  else:
   mod_name = function.__module__
  log.profile('Function {0}.{1} took {2:.20f} seconds to execute'.format(mod_name, function.__name__, (end_time - start_time)))
  return ret
 return wrapped

def timing ( function ) : @ wraps ( function ) def wrapped ( * args , ** kwargs ) : start_time = time . time ( ) ret = function ( * args , ** salt . utils . clean_kwargs ( ** kwargs ) ) end_time = time . time ( ) if function . __module__ . startswith ( 'salt.loaded.int.' ) : mod_name = function . __module__ [ 16 : ] else : mod_name = function . __module__ log . profile ( 'Function {0}.{1} took {2:.20f} seconds to execute' . format ( mod_name , function . __name__ , ( end_time - start_time ) ) ) return ret return wrapped
timing -> t_total execute a function once .