Changeset 0f89116 in flex_extract.git for Source/Python/Mods/profiling.py


Ignore:
Timestamp:
Dec 19, 2019, 8:07:12 PM (4 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
a73c0f6
Parents:
0d99607
Message:

diverse changes due to PEP8 style guide and eliminating grib2flexpart; removed unused parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Source/Python/Mods/profiling.py

    r8463d78 r0f89116  
    3737# FUNCTION
    3838# ------------------------------------------------------------------------------
    39 def timefn(fn):
     39def timefn(func):
    4040    '''
    4141    @Description:
    4242        Decorator function. It takes the inner function as an argument.
    4343    '''
    44     @wraps(fn)
     44    @wraps(func)
    4545    def measure_time(*args, **kwargs):
    4646        '''
     
    6565        '''
    6666
    67         t1 = time.time()
    68         result = fn(*args, **kwargs)
    69         t2 = time.time()
    70         print("@timefn:" + fn.__name__ + " took " + str(t2 - t1) + " seconds")
     67        time1 = time.time()
     68        result = func(*args, **kwargs)
     69        time2 = time.time()
     70        print("@timefn:" + func.__name__ + " took " +
     71              str(time2 - time1) + " seconds")
    7172
    7273        return result
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG