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

◆ timer() [1/9]

xtd::threading::timer::timer ( const timer_callback callback)
explicit

Initializes a new instance of the timer class with an infinite period and an infinite due time, using the newly created timer object as the state object.

Parameters
callbackthe address of a method to be executed
Exceptions
ArgumentNullExceptionThe callback is null.
Remarks
Call this constructor when you want to use the timer object itself as the state object. After creating the timer, use the change method to set the interval and due time.
This constructor specifies an infinite due time before the first callback and an infinite interval between callbacks, in order to prevent the first callback from occurring before the timer object is assigned to the state object.