Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Timestamp Class Reference

#include <Timestamp.h>

Collaboration diagram for Poco::Timestamp:

List of all members.

Public Types

typedef Int64 TimeDiff
 monotonic UTC time value in 100 nanosecond resolution
typedef Int64 TimeVal
typedef Int64 UtcTimeVal
 monotonic UTC time value in microsecond resolution

Public Member Functions

TimeDiff elapsed () const
TimeVal epochMicroseconds () const
std::time_t epochTime () const
bool isElapsed (TimeDiff interval) const
bool operator!= (const Timestamp &ts) const
Timestamp operator+ (TimeDiff d) const
Timestampoperator+= (TimeDiff d)
Timestamp operator- (TimeDiff d) const
TimeDiff operator- (const Timestamp &ts) const
Timestampoperator-= (TimeDiff d)
bool operator< (const Timestamp &ts) const
bool operator<= (const Timestamp &ts) const
Timestampoperator= (const Timestamp &other)
 Destroys the timestamp.
Timestampoperator= (TimeVal tv)
bool operator== (const Timestamp &ts) const
 Updates the Timestamp with the current time.
bool operator> (const Timestamp &ts) const
bool operator>= (const Timestamp &ts) const
void swap (Timestamp &timestamp)
 Timestamp ()
 difference between two timestamps in microseconds
 Timestamp (TimeVal tv)
 Creates a timestamp with the current time.
 Timestamp (const Timestamp &other)
 Creates a timestamp from the given time value.
void update ()
 Swaps the Timestamp with another one.
UtcTimeVal utcTime () const
 ~Timestamp ()
 Copy constructor.

Static Public Member Functions

static Timestamp fromEpochTime (std::time_t t)
static Timestamp fromUtcTime (UtcTimeVal val)
 Creates a timestamp from a std::time_t.
static TimeVal resolution ()
 Creates a timestamp from a UTC time value.

Private Attributes

TimeVal _ts

Detailed Description

A Timestamp stores a monotonic* time value with (theoretical) microseconds resolution. Timestamps can be compared with each other and simple arithmetics are supported.

[*] Note that Timestamp values are only monotonic as long as the systems's clock is monotonic as well (and not, e.g. set back).

Timestamps are UTC (Coordinated Universal Time) based and thus independent of the timezone in effect on the system.

Definition at line 50 of file Timestamp.h.

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

Generated by  Doxygen 1.6.0   Back to index