xtd 0.2.0
Loading...
Searching...
No Matches

◆ timer_callback

using xtd::threading::timer_callback = typedef action<std::any>

Represents the method that handles calls from a xtd::threading::timer.

delegate< void(arguments_t...)> action
Represents a xtd::delegate that has variable parameters and does not return a value.
Definition action.h:20
action< std::any > timer_callback
Represents the method that handles calls from a xtd::threading::timer.
Definition timer_callback.h:28
Header
#include <xtd/threading/timer_callback>
Namespace
xtd::threading
Library
xtd.core
Parameters
stateAn object containing application-specific information relevant to the method invoked by this delegate.
Remarks
Use a xtd::threading::timer_callback delegate to specify the method that is called by a xtd::threading::timer. This method does not execute in the thread that created the timer; it executes in a separate thread pool thread that is provided by the system. The xtd::threading::timer_callback delegate invokes the method once after the start time elapses, and continues to invoke it once per timer interval until the xtd::threading::timer is destroy, or until the xtd::threading::timer::change method is called with the interval value Infinite.
Note
The timer delegate is specified when the timer is constructed, and cannot be changed. The start time for a xtd::threading::timer is passed in the due_time parameter of the xtd::threading::timer constructors, and the period is passed in the period parameter. For an example that demonstrates creating and using a xtd::threading::timer_callback delegate, see xtd::threading::timer.