class MbTime


Public Methods

MbString format(const char *fmt = "%S.%i")
Convert to a string
unsigned long getMsecValue()
Get time in milliseconds (for Xt)
static MbTime getTimeOfDay()
Get the current time (seconds since Jan 1, 1970)
double getValue()
Get time in seconds as a double
void getValue(struct timeval *tv)
Get time in a struct timeval
void getValue(time_t &sec, long &usec)
Get time in seconds & microseconds
static MbTime maxTime()
Get a time far, far into the future
MbTime(double sec)
Constructor taking a double (in seconds)
MbTime(long sec, long usec)
Constructor taking seconds + microseconds
int operator !=(const MbTime &tm)
MbTime operator %(const MbTime &tm)
modulus for two times
friend MbTime operator *(double s, const MbTime &tm)
friend MbTime operator *(const MbTime &tm, double s)
multiplication by scalar
MbTime& operator *=(double s)
destructive multiplication by scalar
friend MbTime operator +(const MbTime &t0, const MbTime &t1)
Addition
MbTime& operator +=(const MbTime &tm)
Destructive addition
friend MbTime operator -(const MbTime &t0, const MbTime &t1)
Subtraction
MbTime operator -()
Unary negation
MbTime& operator -=(const MbTime &tm)
Destructive subtraction
double operator /(const MbTime &tm)
division by another time
friend MbTime operator /(const MbTime &tm, double s)
division by scalar
MbTime& operator /=(double s)
destructive division by scalar
inline MbBool operator <(const MbTime &tm)
relational operators
inline MbBool operator <=(const MbTime &tm)
int operator ==(const MbTime &tm)
equality operators
inline MbBool operator >(const MbTime &tm)
inline MbBool operator >=(const MbTime &tm)
void setMsecValue(unsigned long msec)
Set time from milliseconds
void setToTimeOfDay()
Set to the current time (seconds since Jan 1, 1970)
void setValue(const struct timeval *tv)
Set time from a struct timeval
void setValue(double sec)
Set time from a double (in seconds)
void setValue(long sec, long usec)
Set time from seconds + microseconds
static MbTime zero()
Get a zero time

Private Fields

struct timeval t

Private Methods

MbTime(const struct timeval *tv)
Constructor taking struct timeval

Documentation

MbTime(double sec)
Constructor taking a double (in seconds)

MbTime(long sec, long usec)
Constructor taking seconds + microseconds

static MbTime getTimeOfDay()
Get the current time (seconds since Jan 1, 1970)

void setToTimeOfDay()
Set to the current time (seconds since Jan 1, 1970)

static MbTime zero()
Get a zero time

static MbTime maxTime()
Get a time far, far into the future

void setValue(double sec)
Set time from a double (in seconds)

void setValue(long sec, long usec)
Set time from seconds + microseconds

void setValue(const struct timeval *tv)
Set time from a struct timeval

void setMsecValue(unsigned long msec)
Set time from milliseconds

double getValue()
Get time in seconds as a double

void getValue(time_t &sec, long &usec)
Get time in seconds & microseconds

void getValue(struct timeval *tv)
Get time in a struct timeval

unsigned long getMsecValue()
Get time in milliseconds (for Xt)

MbString format(const char *fmt = "%S.%i")
Convert to a string. The default format is seconds with 3 digits of fraction precision. See the MbTime man page for explanation of the format string.

friend MbTime operator +(const MbTime &t0, const MbTime &t1)
Addition

friend MbTime operator -(const MbTime &t0, const MbTime &t1)
Subtraction

MbTime& operator +=(const MbTime &tm)
Destructive addition

MbTime& operator -=(const MbTime &tm)
Destructive subtraction

MbTime operator -()
Unary negation

friend MbTime operator *(const MbTime &tm, double s)
multiplication by scalar

friend MbTime operator *(double s, const MbTime &tm)

MbTime& operator *=(double s)
destructive multiplication by scalar

friend MbTime operator /(const MbTime &tm, double s)
division by scalar

MbTime& operator /=(double s)
destructive division by scalar

double operator /(const MbTime &tm)
division by another time

MbTime operator %(const MbTime &tm)
modulus for two times

int operator ==(const MbTime &tm)
equality operators

int operator !=(const MbTime &tm)

inline MbBool operator <(const MbTime &tm)
relational operators

inline MbBool operator >(const MbTime &tm)

inline MbBool operator <=(const MbTime &tm)

inline MbBool operator >=(const MbTime &tm)

MbTime(const struct timeval *tv)
Constructor taking struct timeval

struct timeval t


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de