FTimerManager::SetTimer

Sets a timer to call the given native function at a set interval.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/TimerManager.h

Include

#include "TimerManager.h"

Syntax

template<class UserClass>
void SetTimer
(
    FTimerHandle & InOutHandle,
    UserClass * InObj,
    typename FTimerDelegate::TUObjectMethodDelegate< UserClass >::FMethodPtr InTimerMethod,
    float InRate,
    bool InbLoop,
    float InFirstDelay
)

Remarks

Sets a timer to call the given native function at a set interval. If a timer is already set for this handle, it will replace the current timer.

Parameters

Parameter

Description

InOutHandle

If the passed-in handle refers to an existing timer, it will be cleared before the new timer is added. A new handle to the new timer is returned in either case.

InObj

Object to call the timer function on.

InTimerMethod

Method to call when timer fires.

InRate

The amount of time (in seconds) between set and firing. If <= 0.f, clears existing timers.

InbLoop

true to keep firing at Rate intervals, false to fire only once.

InFirstDelay

The time (in seconds) for the first iteration of a looping timer. If < 0.f InRate will be used.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss