@@ -176,7 +176,7 @@ class PerformanceTest {
176176 }
177177 --closure->test ->_iterations ;
178178 uint64_t last = g_last_time.load (butil::memory_order_relaxed);
179- uint64_t now = butil::gettimeofday_us ();
179+ uint64_t now = butil::cpuwide_time_us ();
180180 if (now > last && now - last > 100000 ) {
181181 if (g_last_time.exchange (now, butil::memory_order_relaxed) == last) {
182182 g_client_cpu_recorder <<
@@ -192,7 +192,7 @@ class PerformanceTest {
192192
193193 static void * RunTest (void * arg) {
194194 PerformanceTest* test = (PerformanceTest*)arg;
195- test->_start_time = butil::gettimeofday_us ();
195+ test->_start_time = butil::cpuwide_time_us ();
196196 test->_iterations = FLAGS_test_iterations;
197197
198198 for (int i = 0 ; i < FLAGS_queue_depth; ++i) {
@@ -235,7 +235,7 @@ void Test(int thread_num, int attachment_size) {
235235 }
236236 tests.push_back (t);
237237 }
238- uint64_t start_time = butil::gettimeofday_us ();
238+ uint64_t start_time = butil::cpuwide_time_us ();
239239 bthread_t tid[thread_num];
240240 if (FLAGS_expected_qps > 0 ) {
241241 bthread_t tid;
@@ -250,7 +250,7 @@ void Test(int thread_num, int attachment_size) {
250250 bthread_usleep (10000 );
251251 }
252252 }
253- uint64_t end_time = butil::gettimeofday_us ();
253+ uint64_t end_time = butil::cpuwide_time_us ();
254254 double throughput = g_total_bytes / 1.048576 / (end_time - start_time);
255255 if (FLAGS_test_iterations == 0 ) {
256256 std::cout << " Avg-Latency: " << g_latency_recorder.latency (10 )
0 commit comments