X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/139ea30e15c4cee4ecd47be0b69f0eb3e34b1eab..d9307d006e88025e28457290c9997f7c0f7c4fdc:/tests/benchmarks/bench.cpp diff --git a/tests/benchmarks/bench.cpp b/tests/benchmarks/bench.cpp index 04723a65b7..2662554ef8 100644 --- a/tests/benchmarks/bench.cpp +++ b/tests/benchmarks/bench.cpp @@ -5,7 +5,7 @@ // Created: 2008-07-19 // RCS-ID: $Id$ // Copyright: (c) 2008 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -254,8 +254,8 @@ int BenchApp::OnRun() long timeMin = LONG_MAX, timeMax = 0, timeTotal = 0; - bool ok = true; - for ( long a = 0; a < m_avgCount; a++ ) + bool ok = func->Init(); + for ( long a = 0; ok && a < m_avgCount; a++ ) { wxStopWatch sw; for ( long n = 0; n < m_numRuns && ok; n++ ) @@ -265,9 +265,6 @@ int BenchApp::OnRun() sw.Pause(); - if ( !ok ) - break; - const long t = sw.Time(); if ( t < timeMin ) timeMin = t; @@ -276,6 +273,8 @@ int BenchApp::OnRun() timeTotal += t; } + func->Done(); + if ( !ok ) { wxPrintf("ERROR\n"); @@ -295,6 +294,8 @@ int BenchApp::OnRun() wxPrintf("%.2f avg (min=%ld, max=%ld)\n", (float)timeTotal / times, timeMin, timeMax); } + + fflush(stdout); } return rc;