diff options
| author | Alan Conway <aconway@apache.org> | 2006-11-08 17:07:44 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2006-11-08 17:07:44 +0000 |
| commit | 5be658a8817b8092a7b53b116f622412a5d0aef6 (patch) | |
| tree | bbee363911f47bad6abe245629cacba0ebf3b9be /cpp/src/qpid/sys/Time.h | |
| parent | 85fef3d1e669b240deae82cdd353620667a85e08 (diff) | |
| download | qpid-python-5be658a8817b8092a7b53b116f622412a5d0aef6.tar.gz | |
More reorg to separate APR/posix code, work in progress.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@472545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/Time.h')
| -rw-r--r-- | cpp/src/qpid/sys/Time.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/cpp/src/qpid/sys/Time.h b/cpp/src/qpid/sys/Time.h index 5c7cdfb005..79d17b433b 100644 --- a/cpp/src/qpid/sys/Time.h +++ b/cpp/src/qpid/sys/Time.h @@ -24,28 +24,14 @@ namespace qpid { namespace sys { -/** - * Time since the epoch. - */ -class Time -{ - public: - static const int64_t NANOS = 1000000000; - static const int64_t MICROS = 1000000; - static const int64_t MILLIS = 1000; - - static Time now(); - - Time(int64_t nsecs_) : ticks(nsecs_) {} +inline int64_t msecsToNsecs(int64_t msecs) { return msecs * 1000 *1000; } +inline int64_t nsecsToMsecs(int64_t nsecs) { return nsecs / (1000 *1000); } - int64_t nsecs() const { return ticks; } - int64_t usecs() const { return nsecs()/1000; } - int64_t msecs() const { return usecs()/1000; } - int64_t secs() const { return msecs()/1000; } +/** Nanoseconds since epoch */ +int64_t getTimeNsecs(); - private: - int64_t ticks; -}; +/** Milliseconds since epoch */ +int64_t getTimeMsecs(); }} |
