diff options
Diffstat (limited to 'cpp/include')
-rw-r--r-- | cpp/include/IceUtil/Cond.h | 2 | ||||
-rw-r--r-- | cpp/include/IceUtil/Time.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h index f7b192c300d..dde7d3082a0 100644 --- a/cpp/include/IceUtil/Cond.h +++ b/cpp/include/IceUtil/Cond.h @@ -223,7 +223,7 @@ Cond::timedWaitImpl(const M& mutex, const Time& timeout) const LockState state; mutex.unlock(state); - timeval tv = Time::now() + timeout; + timeval tv = Time::now(Time::Monotonic) + timeout; timespec ts; ts.tv_sec = tv.tv_sec; ts.tv_nsec = tv.tv_usec * 1000; diff --git a/cpp/include/IceUtil/Time.h b/cpp/include/IceUtil/Time.h index b2b5981776a..60e87501031 100644 --- a/cpp/include/IceUtil/Time.h +++ b/cpp/include/IceUtil/Time.h @@ -29,7 +29,8 @@ public: // automatically generated copy constructor and assignment // operator do the right thing. - static Time now(); + enum Clock { Realtime, Monotonic }; + static Time now(Clock = Realtime); static Time seconds(Int64); static Time milliSeconds(Int64); static Time microSeconds(Int64); @@ -194,6 +195,9 @@ private: Time(Int64); Int64 _usec; +#ifdef _WIN32 + static Int64 _frequency; +#endif }; ICE_UTIL_API std::ostream& operator<<(std::ostream&, const Time&); |