Click or drag to resize

PrecisionTimer Class

Represents a high-resolution timer and timestamp class.
Inheritance Hierarchy
SystemObject
  GSFPrecisionTimer

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public class PrecisionTimer : IDisposable
View Source

The PrecisionTimer type exposes the following members.

Constructors
 NameDescription
Public methodPrecisionTimer Initializes a new instance of the PrecisionTimer class.
Top
Properties
 NameDescription
Public propertyAutoReset Gets or sets a value indicating whether the PrecisionTimer should raise the Tick event each time the specified period elapses or only after the first time it elapses.
Public propertyStatic memberCapabilities Gets the system multimedia timer capabilities.
Public propertyEventArgs Gets EventArgs specified in Start(EventArgs) used to pass into Tick event.
Public propertyIsRunning Gets a value indicating whether the PrecisionTimer is running.
Public propertyPeriod Gets or sets the time between Tick events, in milliseconds.
Public propertyResolution Gets or sets the PrecisionTimer resolution, in milliseconds.
Top
Methods
 NameDescription
Public methodStatic memberClearMinimumTimerResolution Clears a previously set minimum timer resolution established using SetMinimumTimerResolution(Int32).
Public methodDispose Releases all the resources used by the PrecisionTimer object.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the PrecisionTimer object and optionally releases the managed resources.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Releases the unmanaged resources before the PrecisionTimer object is reclaimed by GC.
(Overrides ObjectFinalize)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodStatic memberSetMinimumTimerResolution Requests a minimum resolution for periodic timers such as the PrecisionTimer.
Public methodStart Starts the PrecisionTimer.
Public methodStart(EventArgs) Starts the PrecisionTimer with the specified EventArgs.
Public methodStop Stops PrecisionTimer.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventStarted Occurs when the PrecisionTimer has started.
Public eventStopped Occurs when the PrecisionTimer has stopped.
Public eventTick Occurs when the PrecisionTimer period has elapsed.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
For Windows deployments, implementation is based on the Windows multimedia timer. For other deployments, e.g., POSIX, implementation uses a basic timer for compatibility - this should have ~10ms of resolution when used on standard Linux systems.
See Also

Reference

GSF Namespace