Skip to content

Commit 3d0ce2e

Browse files
authored
Add DispatcherTimer to the list of available timer classes (#4371)
* Add DispatcherTimer to the list of available timer classes
1 parent 4c4d4b2 commit 3d0ce2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xml/System.Threading/Timer.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ Sub TimerCallback(state As Object)
8484
The timer delegate is specified when the timer is constructed, and cannot be changed. The method does not execute on the thread that created the timer; it executes on a <xref:System.Threading.ThreadPool> thread supplied by the system.
8585
8686
> [!TIP]
87-
> .NET includes four classes named `Timer`, each of which offers different functionality:
87+
> .NET includes several timer classes, each of which offers different functionality:
8888
>
8989
> - <xref:System.Timers.Timer?displayProperty=nameWithType>, which fires an event and executes the code in one or more event sinks at regular intervals. The class is intended for use as a server-based or service component in a multithreaded environment; it has no user interface and is not visible at runtime.
9090
> - <xref:System.Threading.Timer?displayProperty=nameWithType>, which executes a single callback method on a thread pool thread at regular intervals. The callback method is defined when the timer is instantiated and cannot be changed. Like the <xref:System.Timers.Timer?displayProperty=nameWithType> class, this class is intended for use as a server-based or service component in a multithreaded environment; it has no user interface and is not visible at runtime.
9191
> - <xref:System.Windows.Forms.Timer?displayProperty=nameWithType> (.NET Framework only), a Windows Forms component that fires an event and executes the code in one or more event sinks at regular intervals. The component has no user interface and is designed for use in a single-threaded environment; it executes on the UI thread.
9292
> - <xref:System.Web.UI.Timer?displayProperty=nameWithType> (.NET Framework only), an ASP.NET component that performs asynchronous or synchronous web page postbacks at a regular interval.
93+
> - <xref:System.Windows.Threading.DispatcherTimer?displayProperty=nameWithType>, a timer that's integrated into the `Dispatcher` queue. This timer is processed with a specified priority at a specified time interval.
9394
9495
When you create a timer, you can specify an amount of time to wait before the first execution of the method (due time), and an amount of time to wait between subsequent executions (period). The <xref:System.Threading.Timer> class has the same resolution as the system clock. This means that if the period is less than the resolution of the system clock, the <xref:System.Threading.TimerCallback> delegate will execute at intervals defined by the resolution of the system clock, which is approximately 15 milliseconds on Windows 7 and Windows 8 systems. You can change the due time and period, or disable the timer, by using the <xref:System.Threading.Timer.Change%2A> method.
9596

0 commit comments

Comments
 (0)