pip_services3_components.count.CounterTiming module

pip_services3_components.counters.CounterTiming

CounterTiming implementation

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_components.count.CounterTiming.CounterTiming(counter: str = None, callback: <module 'pip_services3_components.count.ICounterTimingCallback' from '/pip_services3_components/count/ICounterTimingCallback.py'> = None)

Bases: object

Callback object returned by pip_services3_components.count.ICounters.ICounters.begin_timing() to end timing of execution block and update the associated counter.

Example:

timing = counters.begin_timing(“mymethod.exec_time”) # do something timing.end_timing()

end_timing()

Ends timing of an execution block, calculates elapsed time and updates the associated counter.