Skip to main content

LoggingWatch

A class in Root.Township, Alta.Utilities.

Stopwatch that logs how long a step took, at debug, warn or error level.

Constructors​

MemberWhat it is
LoggingWatch()Creates a LoggingWatch from errorLevel.
LoggingWatch(int errorLevel)Creates a LoggingWatch from errorLevel.

Fields​

3 private and internal fields
MemberWhat it is
private int errorLevelLog level: 0 is debug, 1 is warn, anything else is error.
private static Logger loggerClass logger.
private Stopwatch watchThe underlying Stopwatch.

Methods​

MemberWhat it is
void Measure(string name)Stops the watch and logs that the named step took so many milliseconds, at the chosen level.
void Start()Restarts the watch from zero.