Represents both specific time and time interval. More...
#include <WFTime.h>
Classes | |
struct | Info |
Public Member Functions | |
time_t | seconds () const |
time_t | microseconds () const |
float | toMilliseconds () |
WFTime (time_t seconds, suseconds_t microseconds) | |
WFTime (time_t miliseconds) | |
WFTime | addMicroseconds (long us) |
WFTime | addSamples (int sampleCount, int sampleRate) |
Info | getInfo (bool local=false) |
WFTime | getHour (bool local=false) |
Returns the same time rounded down to an hour. | |
string | format (const char *fmt, bool local=false) const |
Formats the time using a format string. More... | |
Static Public Member Functions | |
static WFTime | now () |
Public Attributes | |
struct timeval | time |
Represents both specific time and time interval.
string WFTime::format | ( | const char * | fmt, |
bool | local = false |
||
) | const |
Formats the time using a format string.
The syntax of the format string is the same as for the standard strftime function (see $ man strftime).
fmt | format string |
local | if true, assume the time is local, otherwise use UTC |
strftime
function as declared in the ctime (time.h) header. time_t
type is implemented as an integer containing unix timestamp. While this is true on most systems, there is no guarantee.