Navigation
API > API/Runtime > API/Runtime/Engine
Class to globally manage timers.
| Name | FTimerManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/TimerManager.h |
| Include Path | #include "TimerManager.h" |
Syntax
class FTimerManager : public FNoncopyable
Inheritance Hierarchy
- FNoncopyable → FTimerManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTimerManager
(
UGameInstance* GameInstance |
Timer API | TimerManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FTimerManager() |
TimerManager.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| LastAssignedSerialNumber | uint64 | The last serial number we assigned from this timer manager | TimerManager.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveTimerHeap | TArray< FTimerHandle > | Heap of actively running timers. | TimerManager.h | |
| CurrentlyExecutingTimer | FTimerHandle | Index to the timer delegate currently being executed, or INDEX_NONE if none are executing. | TimerManager.h | |
| InternalTime | double | An internally consistent clock, independent of World. Advances during ticking. | TimerManager.h | |
| LastTickedFrame | uint64 | Set this to GFrameCounter when Timer is ticked. | TimerManager.h | |
| ObjectToTimers | TMap< const void *, TSet< FTimerHandle > > | A map of object pointers to timers with delegates bound to those objects, for quick lookup | TimerManager.h | |
| OwningGameInstance | UGameInstance * | The game instance that created this timer manager. | TimerManager.h | |
| PausedTimerSet | TSet< FTimerHandle > | Set of paused timers. | TimerManager.h | |
| PendingTimerSet | TSet< FTimerHandle > | Set of timers added this frame, to be added after timer has been ticked | TimerManager.h | |
| Timers | TSparseArray< FTimerData > | The array of timers - all other arrays will index into this | TimerManager.h | |
| TimerSourceList | TUniquePtr< FTimerSourceList > | Debugging/tracking information used when TimerManager.BuildTimerSourceList is set | TimerManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearAllTimersForObject
(
void const* Object |
Clears all timers that are bound to functions on the given object. | TimerManager.h | |
void ClearTimer
(
FTimerHandle& InHandle |
Clears a previously set timer, identical to calling SetTimer() with a <= 0.f rate. | TimerManager.h | |
FTimerHandle GenerateHandle
(
int32 Index |
This should be private, but needs to be public for testing. | TimerManager.h | |
TStatId GetStatId() |
TimerManager.h | ||
float GetTimerElapsed
(
FTimerHandle InHandle |
Gets the current elapsed time for the specified timer. | TimerManager.h | |
float GetTimerRate
(
FTimerHandle InHandle |
Gets the current rate (time between activations) for the specified timer. | TimerManager.h | |
float GetTimerRemaining
(
FTimerHandle InHandle |
Gets the time remaining before the specified timer is called | TimerManager.h | |
bool HasBeenTickedThisFrame() |
TimerManager.h | ||
bool IsTimerActive
(
FTimerHandle InHandle |
Returns true if the specified timer exists and is not paused | TimerManager.h | |
bool IsTimerPaused
(
FTimerHandle InHandle |
Returns true if the specified timer exists and is paused | TimerManager.h | |
bool IsTimerPending
(
FTimerHandle InHandle |
Returns true if the specified timer exists and is pending | TimerManager.h | |
FTimerHandle K2_FindDynamicTimerHandle
(
FTimerDynamicDelegate InDynamicDelegate |
Finds a handle to a timer bound to a particular dynamic delegate. | TimerManager.h | |
void ListTimers() |
Debug command to output info on all timers currently set to the log. | TimerManager.h | |
virtual void OnCrash() |
Called from crash handler to provide more debug information. | TimerManager.h | |
void PauseTimer
(
FTimerHandle InHandle |
Pauses a previously set timer. | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes any generic delegate. | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Sets a timer to call the given native function at a set interval. | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes a TFunction | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes a dynamic delegate (e.g. for UFunctions). | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes any generic delegate. | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes a TFunction | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Version that takes a dynamic delegate (e.g. for UFunctions). | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
Sets a timer to call the given native function at a set interval. | TimerManager.h | |
void SetTimer
(
FTimerHandle& InOutHandle, |
TimerManager.h | ||
void SetTimer
(
FTimerHandle& InOutHandle, |
TimerManager.h | ||
void SetTimer
(
FTimerHandle& InOutHandle, |
TimerManager.h | ||
void SetTimer
(
FTimerHandle& InOutHandle, |
TimerManager.h | ||
FTimerHandle SetTimerForNextTick
(
TFunction< void(void)>&& Callback |
Version that takes a TFunction | TimerManager.h | |
FTimerHandle SetTimerForNextTick
(
FTimerDynamicDelegate const& InDynDelegate |
Version that takes a dynamic delegate (e.g. for UFunctions). | TimerManager.h | |
FTimerHandle SetTimerForNextTick
(
FTimerDelegate const& InDelegate |
Version that takes any generic delegate. | TimerManager.h | |
FTimerHandle SetTimerForNextTick
(
UserClass* inObj, |
TimerManager.h | ||
FTimerHandle SetTimerForNextTick
(
UserClass* inObj, |
Sets a timer to call the given native function on the next tick. | TimerManager.h | |
void Tick
(
float DeltaTime |
TimerManager.h | ||
bool TimerExists
(
FTimerHandle InHandle |
Returns true if the specified timer exists | TimerManager.h | |
void UnPauseTimer
(
FTimerHandle InHandle |
Unpauses a previously set timer | TimerManager.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTimerData * FindTimer
(
FTimerHandle const& InHandle |
TimerManager.h | ||
FTimerData const * FindTimer
(
FTimerHandle const& InHandle |
These should be private, but need to be protected so IMPLEMENT_GET_PROTECTED_FUNC works for testing. | TimerManager.h |