Practical Tools for Simple Design
Loading...
Searching...
No Matches
Util::Time Class Reference

A singleton class that provides time-related functionalities. More...

#include <Time.hpp>

Static Public Member Functions

static second_t GetDeltaTime ()
 Get the delta time between frames in seconds. More...
 
static ms_t GetDeltaTimeMs ()
 Get the delta time between frames in milliseconds. More...
 
static ms_t GetElapsedTimeMs ()
 Get the elapsed time from the start of the program in milliseconds. More...
 
static void Update ()
 Update the time. More...
 

Detailed Description

A singleton class that provides time-related functionalities.

This class provides functionalities such as getting the delta time between frames.

Note
It is designed as a singleton, meaning only one instance of this class should exist. Therefore, the user should NOT create their own Time object.

Member Function Documentation

◆ GetDeltaTime()

static second_t Util::Time::GetDeltaTime ( )
inlinestatic

Get the delta time between frames in seconds.

This function returns the time difference between the current frame and the last frame. The time difference is measured in seconds.

Returns
The delta time between frames in seconds.

◆ GetDeltaTimeMs()

static ms_t Util::Time::GetDeltaTimeMs ( )
inlinestatic

Get the delta time between frames in milliseconds.

This function returns the time difference between the current frame and the last frame. The time difference is measured in milliseconds.

Returns
The delta time between frames in milliseconds.

◆ GetElapsedTimeMs()

static ms_t Util::Time::GetElapsedTimeMs ( )
static

Get the elapsed time from the start of the program in milliseconds.

Note
To create a timer, one may call this function to record the time, and then call it again to obtain the time difference.
Returns
The elapsed time from the start of the program in milliseconds.

◆ Update()

static void Util::Time::Update ( )
static

Update the time.

This function updates the current time and the delta time. It is called by Core::Context::Update(). The user is not recommended to call this function.


The documentation for this class was generated from the following file: