UGameplayStatics::GetRealTimeSeconds
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns elapsed time in seconds since the world started, unaffected by time dilation and not stopped when the game is paused. This is the closest equivalent to a wall-clock timer within a world context.
Caveats & Gotchas
- • Although not affected by time dilation, this clock still resets when a new world/level is loaded — it is not an absolute process uptime. Use FPlatformTime::Seconds() for absolute process time.
- • Values from this function are unsuitable for gameplay simulation that should respect slow-motion or pause — use GetTimeSeconds for that.
Signature
static ENGINE_API double GetRealTimeSeconds(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to resolve the current world. | — |
Return Type
double Example
Profile how long a loading operation takes C++
double StartTime = UGameplayStatics::GetRealTimeSeconds(this);
PerformExpensiveOperation();
double Duration = UGameplayStatics::GetRealTimeSeconds(this) - StartTime;
UE_LOG(LogTemp, Log, TEXT("Operation took %.4f real seconds"), Duration); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?