diff --git a/benchmarks/bench_metric.cpp b/benchmarks/bench_metric.cpp index 7e744bd..6645076 100644 --- a/benchmarks/bench_metric.cpp +++ b/benchmarks/bench_metric.cpp @@ -176,29 +176,13 @@ int main() { return gauge_value.load(std::memory_order_relaxed); }); - // Background thread updating callback values - std::atomic stop_callback{false}; - std::latch start_latch{2}; // Background thread + benchmark thread - - std::thread callback_updater([&]() { - start_latch.arrive_and_wait(); // Wait for benchmark to start - while (!stop_callback.load()) { - counter_value.fetch_add(1); - gauge_value.store(gauge_value.load() + 1); - } - }); - ArenaAllocator arena; - start_latch.arrive_and_wait(); // Wait for background thread to be ready bench.run("render() - with callback metrics", [&]() { auto output = metric::render(arena); ankerl::nanobench::doNotOptimizeAway(output); arena.reset(); }); - - stop_callback.store(true); - callback_updater.join(); } // Render performance scaling