What does it mean that a timer is pending?

Hi,

The FTimerManager class has following three methods:

bool IsTimerActive(FTimerHandle) - Returns true if the specified timer exists and is not paused

bool IsTimerPaused(FTimerHandle) - Returns true if the specified timer exists and is paused

bool IsTimerPending(FTimerHandle) - Returns true if the specified timer exists and is pending

I’m confused about the meaning of the “pending” state.

What does it mean that the timer is “pending”?

How does a timer become and/or stop being “pending”?

Regards! :slight_smile:

I looked at TimerManager.h and TimerManager.cpp and I discovered that FTimerManager can only be ticked once per frame. If a timer was added this frame and FTimerManager ticked, then it’s set to Active,but if it was added this frame and it did not tick, then it becomes Pending. Also, whether or not FTimerManager has ticked influences how the timer’s ExpireTime is calculated.

The timer’s status influences how it is cleared, how it’s paused, how it’s unpaused, and whether or not it is executed in the current tick. Also, note that there is an internal Executing state.

In the current tick (once per frame), all active timers are tested to see if they expired to fire the delegate; finally all pending timers are made active so they can update in the next frame.

I think all of this is right.