libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
SystemTime Class Reference

Platform-agnostic monotonic clock. More...

#include <Time.h>

Static Public Member Functions

static Ticks now ()
 
static uint32_t diffSecs (Ticks start, Ticks end)
 
static uint32_t diffMillisecs (Ticks start, Ticks end)
 
static uint32_t diffMicrosecs (Ticks start, Ticks end)
 
static uint64_t ticksToMicrosecs (Ticks ticks)
 

Detailed Description

Platform-agnostic monotonic clock.

Definition at line 24 of file Time.h.

Member Function Documentation

◆ diffMicrosecs()

static uint32_t SystemTime::diffMicrosecs ( Ticks start,
Ticks end )
inlinestatic
Returns
whole microseconds elapsed between two now() samples. This is the granularity an emulator core's frame-sync loop actually needs.
Parameters
startthe earlier sample
endthe later sample - must not be earlier than start

Definition at line 66 of file Time.h.

◆ diffMillisecs()

static uint32_t SystemTime::diffMillisecs ( Ticks start,
Ticks end )
inlinestatic
Returns
whole milliseconds elapsed between two now() samples
Parameters
startthe earlier sample
endthe later sample - must not be earlier than start

Definition at line 52 of file Time.h.

◆ diffSecs()

static uint32_t SystemTime::diffSecs ( Ticks start,
Ticks end )
inlinestatic
Returns
whole seconds elapsed between two now() samples
Parameters
startthe earlier sample
endthe later sample - must not be earlier than start

Definition at line 40 of file Time.h.

◆ now()

static Ticks SystemTime::now ( )
inlinestatic
Returns
the current monotonic timestamp

Definition at line 28 of file Time.h.

◆ ticksToMicrosecs()

static uint64_t SystemTime::ticksToMicrosecs ( Ticks ticks)
inlinestatic
Returns
an already-elapsed raw tick COUNT (not two timestamps to diff) converted to microseconds, as a 64-bit value. Unlike diffMicrosecs() above, this is meant for converting an accumulator that has been summing raw (end - start) tick deltas across many samples - the accumulated total can exceed what diffMicrosecs()'s 32-bit microsecond return can hold long before any single sample would.
Parameters
ticksan elapsed duration, in the same units as Ticks

Definition at line 83 of file Time.h.


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