ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::utils::time Namespace Reference

Functions

void Sleep (const float sleep_time)
 Sleep.
 
double Time ()
 Return the time in seconds since epoch.
 
void SecondsToTimeSpec (const double time, struct timespec &time_spec)
 Convert time in seconds since epoch to a timespec struct.
 
void SecondsToTimeVal (const double time, struct timeval &time_val)
 Convert time in seconds since epoch to timeval struct.
 
std::string IsoTime (const double time_since_epoch, const uint8_t prec=6)
 Generate ISO8601 timestamp from provided time in seconds since epoch.
 
std::string IsoTimeNow (const int8_t prec=6)
 Generate ISO8601 timestamp from time of invoking this function.
 

Function Documentation

◆ IsoTime()

std::string ifw::core::utils::time::IsoTime ( const double time_since_epoch,
const uint8_t prec = 6 )

Generate ISO8601 timestamp from provided time in seconds since epoch.

◆ IsoTimeNow()

std::string ifw::core::utils::time::IsoTimeNow ( const int8_t prec = 6)

Generate ISO8601 timestamp from time of invoking this function.

◆ SecondsToTimeSpec()

void ifw::core::utils::time::SecondsToTimeSpec ( const double time,
struct timespec & time_spec )

Convert time in seconds since epoch to a timespec struct.

◆ SecondsToTimeVal()

void ifw::core::utils::time::SecondsToTimeVal ( const double time,
struct timeval & time_val )

Convert time in seconds since epoch to timeval struct.

◆ Sleep()

void ifw::core::utils::time::Sleep ( const float sleep_time)

Sleep.

Parameters
sleep_timeSleep time in seconds. Note: Blocks the thread in which it is invoked, the entire application if singlethreaded.

◆ Time()

double ifw::core::utils::time::Time ( )

Return the time in seconds since epoch.