4
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2001, Bastiaan Bakker. All rights reserved.
7
* See the COPYING file for the terms of usage and distribution.
10
#ifndef _LOG4SHIB_TIMESTAMP_HH
11
#define _LOG4SHIB_TIMESTAMP_HH
13
#include <log4shib/Portability.hh>
18
* A simple TimeStamp abstraction
20
class LOG4SHIB_EXPORT TimeStamp {
23
Constructs a TimeStamp representing 'now'.
28
Constructs a TimeStamp representing the given offset since the
29
epoch ( 00:00:00 1970/1/1 UTC).
31
TimeStamp(unsigned int seconds, unsigned int microSeconds = 0);
34
Returns the 'seconds' part of the TimeStamp.
36
inline int getSeconds() const {
41
Returns the 'subseconds' part of the TimeStamp in milliseconds,
42
getMilliSeconds() == getMicroSeconds() / 1000.
44
inline int getMilliSeconds() const {
45
return _microSeconds / 1000;
49
Returns the subsecond part of the TimeStamp in microseconds.
50
The actual precision of this value depends on the platform and
51
may be in the order of milliseconds rather than microseconds.
53
inline int getMicroSeconds() const {
58
Returns a TimeStamp representing the time at which the application
61
static inline const TimeStamp& getStartTime() {
66
static TimeStamp _startStamp;
73
#endif // _LOG4SHIB_TIMESTAMP_HH