Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add DispatcherTimer to the list of available timer classes
This is just meant to be a hint.
Why is there's no feedback section at the bottom?

Feel free to close this and do it in a better way.
  • Loading branch information
softworkz authored Jun 12, 2020
commit d794c4c0d8a83b454edefeed25b1c45279190445
3 changes: 2 additions & 1 deletion xml/System.Threading/Timer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ Sub TimerCallback(state As Object)
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.

> [!TIP]
> .NET includes four classes named `Timer`, each of which offers different functionality:
> .NET includes five classes named `Timer`, each of which offers different functionality:
>
> - <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.
> - <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.
> - <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.
> - <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.
> - <xref:System.Windows.Threading.DispatcherTimer?displayProperty=nameWithType> A timer that is integrated into the Dispatcher queue which is processed at a specified interval of time and at a specified priority.

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.

Expand Down