Timer()

Timer::Timer(TimerCallback) constructor

Constructor.

System::Threading::Timer::Timer(TimerCallback callback)

Arguments

ParameterTypeDescription
callbackTimerCallbackFunction to be called by the timer.

Timer::Timer(TimerCallback, const System::SharedPtr<System::Object>&, int64_t, int64_t) constructor

Constructor.

System::Threading::Timer::Timer(TimerCallback callback, const System::SharedPtr<System::Object> &state, int64_t dueTime, int64_t period)

Arguments

ParameterTypeDescription
callbackTimerCallbackFunction to be called by the timer.
stateconst System::SharedPtr<System::Object>&Callback function argument.
dueTimeint64_tTimeout before first invocation of callback function, in milliseconds; negative values doesn’t schedule timer after creation so it can be re-scheduled later.
periodint64_tTimeout between consequental invocations of callback function, in milliseconds; non-positive values mean that timer should only be executed once.

Timer::Timer(TimerCallback, const System::SharedPtr<System::Object>&, System::TimeSpan, System::TimeSpan) constructor

Constructor.

System::Threading::Timer::Timer(TimerCallback callback, const System::SharedPtr<System::Object> &state, System::TimeSpan dueTime, System::TimeSpan period)

Arguments

ParameterTypeDescription
callbackTimerCallbackFunction to be called by the timer.
stateconst System::SharedPtr<System::Object>&Callback function argument.
dueTimeSystem::TimeSpanTimeout before first invocation of callback function; negative values doesn’t schedule timer after creation so it can be re-scheduled later.
periodSystem::TimeSpanTimeout between consequental invocations of callback function; non-positive values mean that timer should only be executed once.

See Also