def time_profile(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        global _global_profile_t0
        global _global_profile_level
        indent = ''.join(['    ' for i in xrange(_global_profile_level)])
        t0 = time.time()
        sys.stdout.write('%s%s\n' % (indent, func.__name__))
        _global_profile_level += 1
        retval = func(*args, **kwargs)
        _global_profile_level -= 1
        sys.stdout.write('%sExecution Time: %s\n%sTotal Time: %s\n' % (indent, time.time() - t0, indent, time.time() - _global_profile_t0))
        return retval
    return wrapper
dataset/ETHPy150Open ooici/pyon/pyon/util/breakpoint.py/time_profile/original