Fireset
Loading...
Searching...
No Matches
Time

Time-related functions. More...

Functions

double fsTimeGetSystemTime (void)
 Returns the current system time.
double fsTimeGetDelta (void)
 Returns the delta time.
double fsTimeGetTime (void)
 Returns the engine running time.
void fsTimeInit (void)
 Initializes the time module.
void fsWait (long ms)
 Waits for a specified duration.

Detailed Description

Time-related functions.

Function Documentation

◆ fsTimeGetDelta()

double fsTimeGetDelta ( void )

Returns the delta time.

Returns the time difference between the current frame and the previous one.

Returns
Delta time.

◆ fsTimeGetSystemTime()

double fsTimeGetSystemTime ( void )

Returns the current system time.

Returns the current system time at the moment this function is called.

Returns
Current system time.

◆ fsTimeGetTime()

double fsTimeGetTime ( void )

Returns the engine running time.

Returns the elapsed time, in seconds, since the time system was initialized with fsTimeInit().

This function provides a monotonic, engine-relative time value and should be used for timing, animations, logging, and time-based calculations inside the engine.

Returns
Time in seconds since fsTimeInit() was called.
Note
This value is independent of the system clock and is not affected by system time changes.
The returned value always increases while the engine runs.

◆ fsTimeInit()

void fsTimeInit ( void )

Initializes the time module.

Initializes the internal time tracking used by the engine.

This function must be called before using any other time-related function.

◆ fsWait()

void fsWait ( long ms)

Waits for a specified duration.

Pauses the program execution for a given number of milliseconds. Works on Windows and POSIX systems.

Parameters
msDuration to wait, in milliseconds.
Note
On Windows, uses Sleep().
On Linux/macOS, uses nanosleep() and handles EINTR.