Click or drag to resize
StopwatchWin32 Class
A version of Stopwatch that uses Win32 performance counter. For regular use, use the Stopwatch class. Since .NET dose not have a close equivalence of the Java ThreadMXBean class, we will not port the StopwatchCPU class. Instead, we use this class as a demonstration of an alternative Stopwatch implementation.
Inheritance Hierarchy
SystemObject
  Algs4NetStopwatchWin32

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class StopwatchWin32

The StopwatchWin32 type exposes the following members.

Constructors
  NameDescription
Public methodStopwatchWin32
Initializes a new stopwatch.
Top
Methods
  NameDescription
Public methodElapsedTime
Returns the elapsed CPU time (in seconds) since the stopwatch was created.
Public methodStatic memberMainTest
Demo test for the data type.
Top
Remarks
For additional documentation, see Section 1.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
See Also