diff options
author | cyy <cyyever@outlook.com> | 2019-01-12 14:38:28 +0800 |
---|---|---|
committer | cyy <cyyever@outlook.com> | 2019-01-22 10:36:18 +0800 |
commit | bfdbd0344bd3ddf348985b51e02212e8092859d4 (patch) | |
tree | 78ba8220a1f8a72f94eb79c053b89df3a3d77f2a /lib/cpp/test/concurrency/ThreadFactoryTests.h | |
parent | d12dbed670acb9fbe65662fb72d2069e5ee6d0a0 (diff) | |
download | thrift-bfdbd0344bd3ddf348985b51e02212e8092859d4.tar.gz |
use chrono
Diffstat (limited to 'lib/cpp/test/concurrency/ThreadFactoryTests.h')
-rw-r--r-- | lib/cpp/test/concurrency/ThreadFactoryTests.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/cpp/test/concurrency/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h index 8ab754c89..ad1613ba9 100644 --- a/lib/cpp/test/concurrency/ThreadFactoryTests.h +++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h @@ -22,7 +22,6 @@ #include <thrift/concurrency/ThreadFactory.h> #include <thrift/concurrency/Monitor.h> #include <thrift/concurrency/Mutex.h> -#include <thrift/concurrency/Util.h> #include <assert.h> #include <iostream> @@ -221,7 +220,7 @@ public: Monitor monitor; - int64_t startTime = Util::currentTime(); + int64_t startTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); for (int64_t ix = 0; ix < count; ix++) { { @@ -233,7 +232,7 @@ public: } } - int64_t endTime = Util::currentTime(); + int64_t endTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); bool success = (endTime - startTime) >= (count * timeout); |