Coverage for src/pymor/tools/timing : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
'''You can use me as a context manager, plain instance or decorator to time execution of a code scope::
with Timer() as timer: do_some_stuff() do more stuff() #outputs time in (s)
### OR ###
@timing.Timer('name', logging.debug) def function(*args): do_stuff
function(1) #outputs time in (s) to logging.debug
### OR ###
timer = timing.Timer() timer.start() do_stuff() timer.stop() print(timer.dt) '''
def new_func(*args, **kwargs):
|