LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::Timer Namespace Reference

Functions

LLGL_EXPORT std::uint64_t Frequency ()
 Returns the timer frequency of the OS. This is the number of ticks per seconds, e.g. 1,000,000 for microseconds.
LLGL_EXPORT std::uint64_t Tick ()
 Returns the current 'tick' of a high resolution timer that is OS dependent. The tick frequency can be queried with Frequency.

Function Documentation

◆ Frequency()

LLGL_EXPORT std::uint64_t LLGL::Timer::Frequency ( )

Returns the timer frequency of the OS. This is the number of ticks per seconds, e.g. 1,000,000 for microseconds.

See also
Tick

◆ Tick()

LLGL_EXPORT std::uint64_t LLGL::Timer::Tick ( )

Returns the current 'tick' of a high resolution timer that is OS dependent. The tick frequency can be queried with Frequency.

Remarks
The following example illustrates how to query the elapsed time in milliseconds between two time stamps:
const std::uint64_t startTime = LLGL::Timer::Tick();
// Some events ...
const std::uint64_t endTime = LLGL::Timer::Tick();
const double elapsedSeconds = static_cast<double>(endTime - startTime) / LLGL::Timer::Frequency();
printf("Elapsed time: %f ms\n", elapsedSeconds * 1000.0);
LLGL_EXPORT std::uint64_t Frequency()
Returns the timer frequency of the OS. This is the number of ticks per seconds, e....
LLGL_EXPORT std::uint64_t Tick()
Returns the current 'tick' of a high resolution timer that is OS dependent. The tick frequency can be...
See also
Frequency