Click or drag to resize

StopwatchCollection Class

Provides a set of methods and properties to accurately measure elapsed time. A collection of stopwatches organized in a tree like manner, each stopwatch can have one parent and many children. If a child stopwatch is started, the parent stopwatch will also be started. Hence, elapsed time covers self time and any child time. If several childs are started, time will only be "recorded once".
Inheritance Hierarchy

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class StopwatchCollection : Stopwatch, 
	IEnumerable<StopwatchCollection>, IEnumerable

The StopwatchCollection type exposes the following members.

Constructors
  NameDescription
Public methodStopwatchCollection
Create a new stopwatch collection with a given name.
Top
Properties
  NameDescription
Public propertyChildWatches
List of all child-stopwatches. All children must have _parent=this
Public propertyElapsed
Gets the total elapsed time measured by the current instance.
(Inherited from Stopwatch.)
Public propertyElapsedMilliseconds
Gets the total elapsed time measured by the current instance, in milliseconds.
(Inherited from Stopwatch.)
Public propertyElapsedTicks
Gets the total elapsed time measured by the current instance, in timer ticks.
(Inherited from Stopwatch.)
Public propertyIsRunning
Gets a value indicating whether the Stopwatch timer is running.
(Inherited from Stopwatch.)
Public propertyName
Name of stopwatch.
Public propertyParent
Parent stopwatch, when this stopwatch is part of another collection.
Public propertyStartCount
Top
Methods
  NameDescription
Public methodAddChild
Add a child to the list of stopwatches. A watch can only be added once to the list. A watch can only be a child of one other collection. The child can not be running.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFind
Within this stopwatch collection, find the stopwatch with the provided name.
Public methodGetEnumerator
Returns an enumerator that iterates through all child watches.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPrintTimings
Simple print-out of timings to Console.
Public methodRemoveChild
Removes a child from the list of stopwatches. The child can not be running.
Public methodReset
Stops time measurement of this watch and all children, and resets the elapsed time of this watch (but not its children).
Public methodResetAll
Stops time measurement of this watch and all children, and resets the elapsed time of this watch and all its children.
Public methodRestart
Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.
(Inherited from Stopwatch.)
Public methodResume
Resumes, measuring elapsed time, does not increment the StartCount. If part of a collection, the parent stopwatch will also be started.
Public methodStart
Starts measuring elapsed time. If part of a collection, the parent stopwatch will also be started.
Public methodStop
Stops measuring elapsed time. If part of a collection, the parent stopwatch will be stopped, if this stopwatch is the one keeping it running.
Public methodStopAll
Stop this stopwatch and all child watches
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also