// Created: 2008-07-19
// RCS-ID: $Id$
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
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++ )
sw.Pause();
- if ( !ok )
- break;
-
const long t = sw.Time();
if ( t < timeMin )
timeMin = t;
timeTotal += t;
}
+ func->Done();
+
if ( !ok )
{
wxPrintf("ERROR\n");
wxPrintf("%.2f avg (min=%ld, max=%ld)\n",
(float)timeTotal / times, timeMin, timeMax);
}
+
+ fflush(stdout);
}
return rc;