Loading...
Searching...
No Matches
TimeStamp.hh
Go to the documentation of this file.
/*
* TimeStamp.hh
*
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2001, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_TIMESTAMP_HH
#define _LOG4SHIB_TIMESTAMP_HH
#include <log4shib/Portability.hh>
namespace log4shib {
class LOG4SHIB_EXPORT TimeStamp {
public:
TimeStamp();
TimeStamp(unsigned int seconds, unsigned int microSeconds = 0);
inline int getSeconds() const {
return _seconds;
};
inline int getMilliSeconds() const {
return _microSeconds / 1000;
};
inline int getMicroSeconds() const {
return _microSeconds;
};
static inline const TimeStamp& getStartTime() {
return _startStamp;
};
protected:
static TimeStamp _startStamp;
int _seconds;
int _microSeconds;
};
}
#endif // _LOG4SHIB_TIMESTAMP_HH
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
Portability.hh
log4shib::TimeStamp::getMicroSeconds
int getMicroSeconds() const
Returns the subsecond part of the TimeStamp in microseconds.
Definition TimeStamp.hh:53
log4shib::TimeStamp::getStartTime
static const TimeStamp & getStartTime()
Returns a TimeStamp representing the time at which the application started.
Definition TimeStamp.hh:61
log4shib::TimeStamp::_startStamp
static TimeStamp _startStamp
Definition TimeStamp.hh:66
log4shib::TimeStamp::_microSeconds
int _microSeconds
Definition TimeStamp.hh:69
log4shib::TimeStamp::getMilliSeconds
int getMilliSeconds() const
Returns the 'subseconds' part of the TimeStamp in milliseconds, getMilliSeconds() == getMicroSeconds(...
Definition TimeStamp.hh:44
log4shib::TimeStamp::_seconds
int _seconds
Definition TimeStamp.hh:68
log4shib::TimeStamp::getSeconds
int getSeconds() const
Returns the 'seconds' part of the TimeStamp.
Definition TimeStamp.hh:36
log4shib::TimeStamp::TimeStamp
TimeStamp()
Constructs a TimeStamp representing 'now'.
Definition TimeStamp.cpp:28
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16