KGy SOFT

HiResTimer Class

KGy SOFT Core Libraries Help
Represents a high resolution timer that allows precise timing even with sub-milliseconds intervals. The timer executes on a separated high priority thread.
Inheritance Hierarchy

SystemObject
  KGySoft.CoreLibrariesHiResTimer

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

public class HiResTimer

The HiResTimer type exposes the following members.

Constructors

  NameDescription
Public methodHiResTimer
Initializes a new instance of the HiResTimer class with 1ms interval.
Public methodHiResTimer(Single)
Initializes a new instance of the HiResTimer class with a specified interval.
Top
Properties

  NameDescription
Public propertyEnabled
Gets or sets whether the Elapsed event should be triggered.
Default value: .
Public propertyIgnoreElapsedThreshold
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: +∞.
Public propertyInterval
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.
Top
Methods

  NameDescription
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 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 methodStart
Starts raising the Elapsed event by enabling the timer.
Public methodStop
Stops raising the Elapsed event by disabling the timer.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events

  NameDescription
Public eventElapsed
Occurs when the Interval elapses.
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
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.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
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.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
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.)
Top
See Also

Reference