Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFStopwatch Class

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFStopwatch Class
A simpler and faster stop watch than System.Diagnostics.Stopwatch.

Inheritance Hierarchy

SystemObject
  OSIsoft.AF.DiagnosticsAFStopwatch

Namespace:  OSIsoft.AF.Diagnostics
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public class AFStopwatch
Public Class AFStopwatch

Dim instance As AFStopwatch
public ref class AFStopwatch
type AFStopwatch =  class end

The AFStopwatch type exposes the following members.

Constructors

  NameDescription
Public method
AFStopwatch
It initializes a new instance of the AFStopwatch class. It begins measuring elapsed time immediately.

Properties

  NameDescription
Public property
ElapsedMilliseconds
Return the elapsed time in milliseconds.

Methods

  NameDescription
Public method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
Start
Starts the stop watch (again if one is currently running).
Public method
ToString
Returns a String that represents the current object.
(Overrides ObjectToString.)

Remarks

The class uses Environment.TickCount. While it is several order of magnitude faster than StopWatch, it is not as accurate and it restarts every 30 days (i.e., in very rare cases, it may return very large negative values).

Version Information

AFSDK


See Also

TitleResults for “How to create a CRG?”Also Available in