PrecisionTimerSetMinimumTimerResolution Method

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

Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static void SetMinimumTimerResolution(
	int period
)

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