31 #include "ctimeexceptions.h"
45 enum ctimeformat { ctf_secnano, ctf_datetime, ctf_dtfile, ctf_ms, ctf_us };
128 ctimeformat print_format;
148 CTime(
double relative);
296 void set(
double milliseconds=-1.0);
double getTimeInMilliseconds(void)
Get time in milliseconds.
unsigned long nanoseconds(void)
Get Nanoseconds.
bool operator<=(CTime &t)
Comparison <= operator.
CTime operator+(CTime &t)
Calculates time addition.
friend std::ostream & operator<<(std::ostream &o, CTime &t)
outputs time into a ostream
static double timespecToMs(timespec t)
conversion from timespec to milliseconds
long getTimeInMicroseconds(void)
Get time in microseconds.
void useRef(bool use)
sets if use or not the reference internal time
bool operator!=(CTime &t)
Comparison operator.
void setRef()
Sets the internal reference time.
CTime operator-(CTime &t)
Calculates time difference.
timeval getTimeInTimeval(void)
Get time in a timeval strcuture.
unsigned long seconds(void)
Get Seconds.
bool operator>(CTime &t)
Comparison > operator.
bool operator==(CTime &t)
Comparison operator.
std::string getString(void)
Gives a formatted string of this time.
time_t getTimeInTime_t(void)
Get time in time_t.
Implementation of a time class and operations.
ctimeformat getFormat()
Gets output string format.
static timespec msToTimespec(double ms)
conversion from milliseconds to timespec
timespec getTimeInTimespec(void)
Get time in a timespec strcuture.
double getTimeInSeconds(void)
Get time in seconds.
void setFormat(ctimeformat format)
Sets output string format.
void set(double milliseconds=-1.0)
Sets the internal time.
bool operator<(CTime &t)
Comparison < operator.
bool isRefUsed()
Get if is used or not the reference internal time.
CTime operator/(int div)
Calculates division by integer.
bool operator>=(CTime &t)
Comparison >= operator.
CTime getRef()
Get the reference internal time.
void resetRef()
Resets the reference time to the epoch.