DDraceNetwork Docs
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 ()
 
int64_t time_get_impl ()
 
int64_t time_get ()
 
int64_t time_freq ()
 
int64_t time_timestamp ()
 
int time_houroftheday ()
 
ETimeSeason time_season ()
 
std::chrono::nanoseconds time_get_nanoseconds ()
 

Detailed Description

Time utilities.

Enumeration Type Documentation

◆ ETimeSeason

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 ( )

◆ time_freq()

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

◆ time_get()

int64_t time_get ( )

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.
Uses time_get_impl to fetch the 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 in 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
See also
SEASON_SPRING

◆ time_timestamp()

int64_t time_timestamp ( )

Retrieves the current time as a UNIX timestamp

Returns
The time as a UNIX timestamp