From 5a76830b73123b45e6189bd73c5fa3e6c3e4f2b1 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 24 Jun 2015 21:39:59 -0700 Subject: [PATCH] bug 2127: Scheduler benchmark utility works correctly in first run only (patch due to Philipp Andelfinger) --- utils/bench-simulator.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/bench-simulator.cc b/utils/bench-simulator.cc index cf836dddb..14aa39747 100644 --- a/utils/bench-simulator.cc +++ b/utils/bench-simulator.cc @@ -80,6 +80,8 @@ Bench::RunBench (void) double init, simu; DEB ("initializing"); + m_count = 0; + time.Start (); for (uint32_t i = 0; i < m_population; ++i) @@ -105,14 +107,12 @@ Bench::RunBench (void) std::setw (g_fwidth) << (m_count / simu) << std::setw (g_fwidth) << (simu / m_count)); - // Clean up scheduler - Simulator::Destroy (); } void Bench::Cb (void) { - if (m_count > m_total) + if (m_count >= m_total) { return; } @@ -271,4 +271,7 @@ int main (int argc, char *argv[]) LOG (""); return 0; + + Simulator::Destroy (); + }