From 7d0e9ab80319534656dda7526fa17b8f5b9ef44b Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Thu, 22 Aug 2024 15:24:18 +0800 Subject: [PATCH] fix perf_workpool nanoseconds --- thread/test/perf_workpool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thread/test/perf_workpool.cpp b/thread/test/perf_workpool.cpp index ae7ba9a6..20e15fe1 100644 --- a/thread/test/perf_workpool.cpp +++ b/thread/test/perf_workpool.cpp @@ -37,7 +37,7 @@ static void workload(uint64_t time_us) { do { auto diff = std::chrono::steady_clock::now() - start; diff_ns = std::chrono::duration_cast(diff).count(); - } while (diff_ns < (long) time_us); + } while (diff_ns < (long) time_us * 1000); } static void task_async() { @@ -143,4 +143,4 @@ int main(int argc, char** arg) { FLAGS_fires, FLAGS_vcpu_num, get_qps(start, end), sum_time.load() / FLAGS_fires); -} \ No newline at end of file +}