CoreWebView2Settings.PreferredForegroundTimerWakeInterval Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public TimeSpan PreferredForegroundTimerWakeInterval { get; set; }
member this.PreferredForegroundTimerWakeInterval : TimeSpan with get, set
Public Property PreferredForegroundTimerWakeInterval As TimeSpan
Property Value
Remarks
A WebView is in foreground state when its IsVisible
property is TRUE
. This aligns to the Chromium concept of foreground, which means programmatically visible, even if occluded. For more details, see Page Visibility API.
A wake up interval is the amount of time that needs to pass before the WebView2 Runtime checks for new timer tasks to run.
The WebView2 Runtime will try to respect the preferred interval set by the application, but the effective value will be constrained by resource and platform limitations. Setting a value of 0
means a preference of 0 ms between timer wake ups. The default value is a constant determined by the running version of the WebView2 Runtime. Setting the value of this property will take effect immediately.
For example, an application might use a foreground value of 30 ms for moderate throttling scenarios. In this case, timers will run at most every 30 ms. Or the application could get and match the default background value (usually 1000 ms).