diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-09-05 14:44:03 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-09-05 14:44:03 -0230 |
commit | bdcf4f222f50b915d2dfc0ea3960758adf6937db (patch) | |
tree | e263a048b6297395c97e860c87a0ca27b569cb08 /cpp/demo/Freeze/customEvictor/Client.cpp | |
parent | Added missing file (diff) | |
download | ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.tar.bz2 ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.tar.xz ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1351 - use monotonic timers where possible
Diffstat (limited to 'cpp/demo/Freeze/customEvictor/Client.cpp')
-rw-r--r-- | cpp/demo/Freeze/customEvictor/Client.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/demo/Freeze/customEvictor/Client.cpp b/cpp/demo/Freeze/customEvictor/Client.cpp index 66c3b804bdf..80bf2a11c76 100644 --- a/cpp/demo/Freeze/customEvictor/Client.cpp +++ b/cpp/demo/Freeze/customEvictor/Client.cpp @@ -48,7 +48,7 @@ public: // // Measures how long it takes to read 'readCount' items at random // - IceUtil::Time start = IceUtil::Time::now(); + IceUtil::Time start = IceUtil::Time::now(IceUtil::Time::Monotonic); try { @@ -64,7 +64,8 @@ public: ItemPrx item = ItemPrx::uncheckedCast(_anItem->ice_identity(identity)); item->getDescription(); } - _requestsPerSecond = static_cast<int>(readCount / (IceUtil::Time::now() - start).toSecondsDouble()); + _requestsPerSecond = + static_cast<int>(readCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - start).toSecondsDouble()); } catch(const IceUtil::Exception& e) { @@ -99,7 +100,7 @@ public: // // Measure how long it takes to write 'writeCount' items at random. // - IceUtil::Time start = IceUtil::Time::now(); + IceUtil::Time start = IceUtil::Time::now(IceUtil::Time::Monotonic); try { @@ -117,7 +118,8 @@ public: item->adjustStock(1); } - _requestsPerSecond = static_cast<int>(writeCount / (IceUtil::Time::now() - start).toSecondsDouble()); + _requestsPerSecond = + static_cast<int>(writeCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - start).toSecondsDouble()); } catch(const IceUtil::Exception& e) { |