ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
ctd::time Namespace Reference

Functions

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

Detailed Description

Function Documentation

std::string ctd::time::IsoTime ( const double  time_since_epoch,
const uint8_t  prec = 6 
)

Generate ISO8601 timestamp from provided time in seconds since epoch.

std::string ctd::time::IsoTimeNow ( const int8_t  prec = 6)

Generate ISO8601 timestamp from time of invoking this function.

void ctd::time::SecondsToTimeSpec ( const double  time,
struct timespec &  time_spec 
)

Convert time in seconds since epoch to a timespec struct.

void ctd::time::SecondsToTimeVal ( const double  time,
struct timeval &  time_val 
)

Convert time in seconds since epoch to timeval struct.

void ctd::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.
double ctd::time::Time ( )

Return the time in seconds since epoch.