HiResTimer Class

Represents a high resolution timer that allows precise timing even with sub-milliseconds intervals. The timer executes on a separated high priority thread.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.0.0
C#
public class HiResTimer
Inheritance
Object    HiResTimer

Constructors

HiResTimer Initializes a new instance of the HiResTimer class with 1ms interval.
HiResTimer(Single) Initializes a new instance of the HiResTimer class with a specified interval.

Properties

Enabled Gets or sets whether the Elapsed event should be triggered.
Default value: .
IgnoreElapsedThreshold Gets or sets a threshold value, in milliseconds, to ignore an Elapsed event (and thus trying to catch up the timer) if the next invoke is late by the given value. Value must not be zero but fractions are allowed.
Default value: +∞.
Interval Gets or sets the interval, in milliseconds, before Elapsed event is triggered. Fractional values are allowed, too. When zero, the Elapsed event is triggered as often as possible.
Default value: 1.0, if initialized by the default constructor; otherwise, as specified in the constructor.

Methods

Start Starts raising the Elapsed event by enabling the timer.
Stop Stops raising the Elapsed event by disabling the timer.

Events

Elapsed Occurs when the Interval elapses.

Extension Methods

Convert Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions)
ConvertTTarget Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions)
In Gets whether item is among the elements of set.
See the Examples section of the generic InT(T, T) overload for an example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)

See Also