RealDocs

FTimerManager::GenerateHandle

function Engine Since 4.0
#include "TimerManager.h"
Access: public Specifiers: ENGINE_API

Description

Creates a valid FTimerHandle for the timer at the given internal sparse-array index, encoding the index and a serial number into the handle. Exposed as public for testing purposes but is not intended for general use.

Caveats & Gotchas

  • This function is explicitly marked as public only to support unit-testing infrastructure (IMPLEMENT_GET_PROTECTED_FUNC). Calling it with an arbitrary Index in production code will produce a dangling handle that could corrupt timer state.
  • The serial number component of the returned handle increments globally via LastAssignedSerialNumber; every call consumes a serial even if the handle is discarded, so excessive calls could theoretically exhaust the 64-bit counter in extremely long-running processes.

Signature

ENGINE_API FTimerHandle GenerateHandle(int32 Index)

Parameters

Name Type Description Default
Index int32 The sparse-array index of the timer entry to generate a handle for.

Return Type

FTimerHandle

Example

Internal engine usage pattern (for reference) C++
// The engine calls this when adding a new timer entry:
// FTimerHandle NewHandle = GenerateHandle(TimerIndex);
// Do not call this directly; use SetTimer and keep the returned handle.

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.