chsvlib
chsv helper source code

◆ chsv_xtime_get()

int Chusov::ExecutionControl::chsv_xtime_get ( chsv_xtime xt,
int  base 
)
noexcept

Sets the specified chsv_xtime object to hold the current time based on the specified time base.

Parameters
[out]xtis a pointer to an output buffer receiving a current time based on the value of base.
[in]baseis a base of time returned. The value of the parameter must be CHSV_TIME_UTC.
Returns
On success the function returns a nonzero value of CHSV_TIME_UTC. On failure the function sets the corresponding errno code and returns 0.

The returned time is defined as an amount of seconds and nanoseconds passed since the Epoch.

A definition of the Epoch is operating system dependent. For Windows the Epoch is 12:00 A.M. January 1, 1601 UTC. For UNIX and UNIX based OS the Epoch is 12:00 A.M. January 1, 1970 UTC.

Although the chsv_xtime describes time with nanosecond resolution, the actual resolution is system dependent.

The function implements a behaviour of the xtime_get function defined in the ISO/IEC 9899:2011 (aka C11) standard.

See also
chsv_xtime.