Click or drag to resize

PrecisionTimerSetMinimumTimerResolution Method

Requests a minimum resolution for periodic timers such as the PrecisionTimer.

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public static void SetMinimumTimerResolution(
	int period
)
View Source

Parameters

period  Int32
Minimum timer resolution, in milliseconds, for the application. A lower value specifies a higher (more accurate) resolution.
Remarks

Call this function immediately before using the PrecisionTimer and call ClearMinimumTimerResolution(Int32) immediately after you are finished using the PrecisionTimer. You must match each call to SetMinimumTimerResolution(Int32) with a call to ClearMinimumTimerResolution specifying the same minimum resolution period in both calls. An application can make multiple ClearMinimumTimerResolution calls as long as each call is matched with a call to ClearMinimumTimerResolution. This function affects a global Windows setting. Windows uses the lowest value (that is, highest resolution) requested by any process. Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. High resolutions can also prevent the CPU power management system from entering power-saving modes. See timeBeginPeriod Windows API for more information.

This method is currently ignored under Mono deployments.

See Also