Public Member Functions | Static Public Member Functions

FCam::Time Class Reference

Time represents a wall clock time. More...

#include <Time.h>

List of all members.

Public Member Functions

 Time (int s, int us)
 Construct a Time from a number of seconds and microseconds.
 Time (timeval t_)
 Construct a Time from a timeval.
 Time (struct timespec t_)
 Construct a Time from a struct timespec.
int s () const
 The number of seconds since the epoch.
int us () const
 The number of microseconds since the last second.
Arithmetic

You can add or subtract a number of microseconds to a time to create a nearby time, or subtract to times to get the difference in microseconds.

Time operator+ (int usecs) const
Time operator+= (int usecs)
Time operator- (int usecs) const
Time operator-= (int usecs)
int operator- (const Time &other) const
Comparison

Times can be compared using the standard operators

bool operator< (const Time &other) const
bool operator> (const Time &other) const
bool operator>= (const Time &other) const
bool operator<= (const Time &other) const
bool operator== (const Time &other) const
bool operator!= (const Time &other) const
Casting

Time can be cast to a timeval or struct timespec for use in syscalls.

 operator timeval ()
 operator struct timespec ()

Static Public Member Functions

static Time now ()
 The current time.

Detailed Description

Time represents a wall clock time.

Not to be used for representing a duration of time. Two times can be subtracted to return the difference between them in microseconds. A number of microseconds can be added to or subtracted from time to return a new time. Times also support all the comparison operators.

Definition at line 20 of file Time.h.


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