Package schrodinger :: Package application :: Package desmond :: Package packages :: Module timer :: Class Timer
[hide private]
[frames] | no frames]

Class Timer

object --+
         |
        Timer


You can use this class to create your own timer function with custom default
behavior.

Example usage:

  from schrodinger.application.desmond.packages.timer import Timer

  mytimer = Timer(threshold=0.2)
  # Creates a timer with 0.2 threshold.

  with mytimer("Reading the trajectory..."):
    traj.read_trj(trj_fname)

In this example, C{mytimer} behaves exactly the same as the standard
C{timer} (see the docstring of this module) except for the default value of
C{threshold} parameter that has been customed to 0.2.

Nested Classes [hide private]
  Args
Args(message, threshold, fmt, record, logger)
Instance Methods [hide private]
 
__init__(self, message=None, threshold=0.1, fmt=' Done. (%.2f sec)', record=None, logger=<function _default_logger at 0x7f1a0fe9be60>)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__call__(*args, **kwds)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, message=None, threshold=0.1, fmt=' Done. (%.2f sec)', record=None, logger=<function _default_logger at 0x7f1a0fe9be60>)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__call__(*args, **kwds)
(Call operator)

 
Decorators:
  • @contextmanager