diff options
author | 2015-07-10 16:43:58 -0700 | |
---|---|---|
committer | 2015-07-10 16:43:58 -0700 | |
commit | d1c925402964f5c1139d71ff7fe5cac97b1ee257 (patch) | |
tree | 49cfb2ff68a32ddc5ebfb3e771dcdcc334c25c0a /test/cpp/qps | |
parent | 25adcaa164780075cf85ae63774e0cae867effff (diff) | |
parent | 080d6c50bbed3dde739b2de610023d8bd8d7966f (diff) |
Merge pull request #2289 from ctiller/footprints-on-the-sands-of-time
Introduce multiple clocks to GPR
Diffstat (limited to 'test/cpp/qps')
-rw-r--r-- | test/cpp/qps/driver.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/timer.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/worker.cc | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index c8cc11e6ab..5597bcd549 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -185,7 +185,7 @@ std::unique_ptr<ScenarioResult> RunScenario( // Let everything warmup gpr_log(GPR_INFO, "Warming up"); - gpr_timespec start = gpr_now(); + gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME); gpr_sleep_until(gpr_time_add(start, gpr_time_from_seconds(warmup_seconds))); // Start a run diff --git a/test/cpp/qps/timer.cc b/test/cpp/qps/timer.cc index d1b6bc1e55..07289f699b 100644 --- a/test/cpp/qps/timer.cc +++ b/test/cpp/qps/timer.cc @@ -41,7 +41,7 @@ Timer::Timer() : start_(Sample()) {} double Timer::Now() { - auto ts = gpr_now(); + auto ts = gpr_now(GPR_CLOCK_REALTIME); return ts.tv_sec + 1e-9 * ts.tv_nsec; } diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index 14a8b0b089..2bc0a56970 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -57,7 +57,8 @@ static void RunServer() { QpsWorker worker(FLAGS_driver_port, FLAGS_server_port); while (!got_sigint) { - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5))); + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5))); } } |