DDraceNetwork Documentation
Loading...
Searching...
No Matches
Time

Enumerations

enum  ETimeSeason {
  SEASON_SPRING = 0 , SEASON_SUMMER , SEASON_AUTUMN , SEASON_WINTER ,
  SEASON_EASTER , SEASON_HALLOWEEN , SEASON_XMAS , SEASON_NEWYEAR
}

Functions

void set_new_tick ()
std::chrono::nanoseconds time_get_nanoseconds ()
int64_t time_get_impl ()
int64_t time_get ()
int64_t time_freq ()
int time_houroftheday ()
ETimeSeason time_season ()

Detailed Description

Time utilities.

Timestamps

Enumeration Type Documentation

◆ ETimeSeason

A season of the year or seasonal event.

Enumerator
SEASON_SPRING 
SEASON_SUMMER 
SEASON_AUTUMN 
SEASON_WINTER 
SEASON_EASTER 
SEASON_HALLOWEEN 
SEASON_XMAS 
SEASON_NEWYEAR 

Function Documentation

◆ set_new_tick()

void set_new_tick ( )

Clears the cached sample of the high resolution timer.

See also
time_get

◆ time_freq()

int64_t time_freq ( )
Returns
The frequency of the high resolution timer.

◆ time_get()

int64_t time_get ( )

Fetches a cached sample from a high resolution timer.

Returns
Current value of the timer.
Remarks
To know how fast the timer is ticking, see time_freq.
The value is cached for each tick, see set_new_tick. Uses time_get_impl to fetch the uncached sample.
See also
time_freq time_get_impl

◆ time_get_impl()

int64_t time_get_impl ( )

Fetches a sample from a high resolution timer.

Returns
Current value of the timer.
Remarks
To know how fast the timer is ticking, see time_freq.
See also
time_freq

◆ time_get_nanoseconds()

std::chrono::nanoseconds time_get_nanoseconds ( )

Fetches a sample from a high resolution timer and converts it to nanoseconds.

Returns
Current value of the timer in nanoseconds.

◆ time_houroftheday()

int time_houroftheday ( )

Retrieves the hours since midnight (0..23).

Returns
The current hour of the day.

◆ time_season()

ETimeSeason time_season ( )

Retrieves the current season of the year.

Returns
One of the SEASON_* enum literals.