Module profiling
Profiling and timing decorators.
For more information on profiling python code, see also
https://internal.schrodinger.com/products/development/docs/software_engineering/profiling.html#profiling-python-code
A very simple example showing the use the profiling and timing decorators
import time
@profiling
def profiled_function(duration=0.05):
time.sleep(duration)
@timing
def timed_function(duration=0.05):
time.sleep(duration)
class Test(object):
@profiling
def profiledMethod(self, duration=0.05):
time.sleep(duration)
@timing
def timedMethod(self, duration=0.05):
time.sleep(duration)
test = Test()
# call the profiled method
test.profiledMethod()
# call the timed method
test.timedMethod(0.1)
# call the profiled function
profiled_function()
# call the timed function
timed_function(0.1)
|
profiling(f)
Decorator that will generate a profile file with the name of the
decorated function or method and time stamp. |
|
|
|
timing(f)
Decorator that will print the duration of the execution of decorated
function or method to the terminal. |
|
|
|
__package__ = ' schrodinger.utils '
|
Decorator that will generate a profile file with the name of the
decorated function or method and time stamp. The duration of the
execution of decorated function or method will also be printed to the
terminal.
- Decorators:
|
Decorator that will print the duration of the execution of decorated
function or method to the terminal.
- Decorators:
|