Agreed.
In a sense, counters are not to be used in this loop counting. It is more likely you could say time stamp check.
// Function to be called after the delay
void YourClass::YourDelayedFunction()
{
// This code will execute after the delay
UE_LOG(LogTemp, Warning, TEXT("Delayed function executed."));
}
// Function to start the delay
void YourClass::StartDelay()
{
// Set the delay time in seconds (e.g., 5 seconds)
float DelayTime = 5.0f;
// Create a timer handle
FTimerHandle TimerHandle;
// Set the timer to call YourDelayedFunction after the specified delay
GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &YourClass::YourDelayedFunction, DelayTime, false);
}