![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GenericPlatformTime.h>
Inheritance diagram for FGenericPlatformTime:Static Public Member Functions | |
| static CORE_API TCHAR * | StrDate (TCHAR *Dest, SIZE_T DestSize) |
| static CORE_API TCHAR * | StrTime (TCHAR *Dest, SIZE_T DestSize) |
| static CORE_API const TCHAR * | StrTimestamp () |
| static CORE_API FString | PrettyTime (double Seconds) |
| static bool | UpdateCPUTime (float DeltaTime) |
| static bool | UpdateThreadCPUTime (float=0.0) |
| static void | AutoUpdateGameThreadCPUTime (double UpdateInterval) |
| static FCPUTime | GetCPUTime () |
| static FCPUTime | GetThreadCPUTime () |
| static double | GetLastIntervalCPUTimeInSeconds () |
| static double | GetLastIntervalThreadCPUTimeInSeconds () |
| static double | GetSecondsPerCycle () |
| static float | ToMilliseconds (const uint32 Cycles) |
| static float | ToSeconds (const uint32 Cycles) |
| static double | GetSecondsPerCycle64 () |
| static double | ToMilliseconds64 (const uint64 Cycles) |
| static double | ToSeconds64 (const uint64 Cycles) |
| static uint64 | SecondsToCycles64 (double Seconds) |
Static Protected Attributes | |
| static CORE_API double | SecondsPerCycle = 0.0 |
| static CORE_API double | SecondsPerCycle64 = 0.0 |
| static CORE_API double | LastIntervalCPUTimeInSeconds = 0.0 |
Generic implementation for most platforms
Registers automatic updates of Game Thread CPU utilization
Gets the per-thread CPU processing time (kernel + user) from the last update
Each platform implements these two functions, which return the current time in platform-specific cpu cycles. Cycles64 should be used for most purposes as it may be higher resolution and will not roll over during execution:
static uint32 Cycles(); static uint64 Cycles64(); Returns seconds per cycle, to pair with Cycles().
Returns seconds per cycle, to pair with Cycles64().
Gets current threads CPU Utilization
|
static |
Returns a pretty-string for a time given in seconds. (I.e. "4:31 min", "2:16:30 hours", etc)
| Seconds | Time in seconds |
Convert seconds to cycles, can be added to Cycles64 to set a high resolution timeout
Get the system date
| Dest | Destination buffer to copy to |
| DestSize | Size of destination buffer in characters |
Get the system time
| Dest | Destination buffer to copy to |
| DestSize | Size of destination buffer in characters |
|
static |
Returns a timestamp string built from the current date and time. NOTE: Only one return value is valid at a time!
Converts cycles to milliseconds.
Converts 64 bit cycles to milliseconds.
Converts cycles to seconds.
Converts 64 bit cycles to seconds.
Updates CPU utilization, called through a delegate from the Core ticker.
Updates current thread CPU utilization, calling is user defined per-thread (unused float parameter, is for FTicker compatibility).
|
staticprotected |
|
staticprotected |
|
staticprotected |