Dela via


ThreadPoolTimer.CreateTimer Method

Definition

Overloads

CreateTimer(TimerElapsedHandler, TimeSpan)

Creates a single-use timer.

CreateTimer(TimerElapsedHandler, TimeSpan, TimerDestroyedHandler)

Creates a single-use timer and specifies a method to call after the timer is complete. The timer is complete when the timer has expired and the final call to handler has finished.

CreateTimer(TimerElapsedHandler, TimeSpan)

Creates a single-use timer.

public:
 static ThreadPoolTimer ^ CreateTimer(TimerElapsedHandler ^ handler, TimeSpan delay);
/// [Windows.Foundation.Metadata.Overload("CreateTimer")]
 static ThreadPoolTimer CreateTimer(TimerElapsedHandler const& handler, TimeSpan const& delay);
[Windows.Foundation.Metadata.Overload("CreateTimer")]
public static ThreadPoolTimer CreateTimer(TimerElapsedHandler handler, System.TimeSpan delay);
function createTimer(handler, delay)
Public Shared Function CreateTimer (handler As TimerElapsedHandler, delay As TimeSpan) As ThreadPoolTimer

Parameters

handler
TimerElapsedHandler

The method to call when the timer expires.

delay
TimeSpan TimeSpan

The amount of time until the timer expires.

C++ This amount of time is specified in ticks (100-nanosecond units) using the Windows::Foundation::TimeSpan structure.

JavaScript and C# This amount of time is specified using the System.TimeSpan structure. It can be specified in ticks, or it can be specified in milliseconds, seconds, and so on.

Returns

An instance of a single-use timer.

Attributes

See also

Applies to

CreateTimer(TimerElapsedHandler, TimeSpan, TimerDestroyedHandler)

Creates a single-use timer and specifies a method to call after the timer is complete. The timer is complete when the timer has expired and the final call to handler has finished.

public:
 static ThreadPoolTimer ^ CreateTimer(TimerElapsedHandler ^ handler, TimeSpan delay, TimerDestroyedHandler ^ destroyed);
/// [Windows.Foundation.Metadata.Overload("CreateTimerWithCompletion")]
 static ThreadPoolTimer CreateTimer(TimerElapsedHandler const& handler, TimeSpan const& delay, TimerDestroyedHandler const& destroyed);
[Windows.Foundation.Metadata.Overload("CreateTimerWithCompletion")]
public static ThreadPoolTimer CreateTimer(TimerElapsedHandler handler, System.TimeSpan delay, TimerDestroyedHandler destroyed);
function createTimer(handler, delay, destroyed)
Public Shared Function CreateTimer (handler As TimerElapsedHandler, delay As TimeSpan, destroyed As TimerDestroyedHandler) As ThreadPoolTimer

Parameters

handler
TimerElapsedHandler

The method to call when the timer expires.

delay
TimeSpan TimeSpan

The amount of time until the timer expires.

C++ This amount of time is specified in ticks (100-nanosecond units) using the Windows::Foundation::TimeSpan structure.

JavaScript and C# This amount of time is specified using the System.TimeSpan structure. It can be specified in ticks, or it can be specified in milliseconds, seconds, and so on.

destroyed
TimerDestroyedHandler

The method to call after the timer is complete.

Returns

An instance of a single-use timer.

Attributes

See also

Applies to