diff --git a/src/common/perf_timer.cpp b/src/common/perf_timer.cpp index 41e23130d..16abdfd99 100644 --- a/src/common/perf_timer.cpp +++ b/src/common/perf_timer.cpp @@ -49,16 +49,15 @@ namespace #ifdef __x86_64__ uint64_t get_ticks_per_ns() { - uint64_t t0 = epee::misc_utils::get_ns_count(); + uint64_t t0 = epee::misc_utils::get_ns_count(), t1; uint64_t r0 = get_tick_count(); while (1) { - uint64_t t = epee::misc_utils::get_ns_count(); - if (t - t0 > 1*1000000000) break; // work one second + t1 = epee::misc_utils::get_ns_count(); + if (t1 - t0 > 1*1000000000) break; // work one second } - uint64_t t1 = epee::misc_utils::get_ns_count(); uint64_t r1 = get_tick_count(); uint64_t tpns256 = 256 * (r1 - r0) / (t1 - t0); return tpns256 ? tpns256 : 1;