waterfall  0.2dev
 All Classes Files Functions Variables Enumerations Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
WFTime Struct Reference

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
 

Detailed Description

Represents both specific time and time interval.

Member Function Documentation

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

Parameters
fmtformat string
localif true, assume the time is local, otherwise use UTC
Returns
formated date
Note
This function uses the strftime function as declared in the ctime (time.h) header.
Implementation of this function assumes that

time_t

type is implemented as an integer containing unix timestamp. While this is true on most systems, there is no guarantee.


The documentation for this struct was generated from the following files: