- wxStopWatch wxPos;
- for (int i=0; i < tests; i++)
- {
- DO_LONG_POSITIONAL_BENCHMARK(wxSnprintf)
- DO_POSITIONAL_BENCHMARK(wxSnprintf)
- }
- wxPos.Pause();
-#endif
-
- // benchmark system implementation of snprintf()
- wxStopWatch sys;
- for (int i=0; i < tests; i++)
- {
- DO_LONG_BENCHMARK(sys_printf)
- DO_BENCHMARK(sys_printf)
- }
- sys.Pause();
-
-#if wxSYSTEM_HAS_POSPARAM_SUPPORT
- wxStopWatch sysPos;
- for (int i=0; i < tests; i++)
- {
- DO_LONG_POSITIONAL_BENCHMARK(wxSnprintf)
- DO_POSITIONAL_BENCHMARK(wxSnprintf)
- }
- sysPos.Pause();
-#endif
-
-#else // !wxTEST_WX_ONLY
-
- // fake stopwatches
- wxStopWatch wxPos, sys, sysPos;
- wxPos.Pause();
- sys.Pause();
- sysPos.Pause();
-
-#endif // !wxTEST_WX_ONLY
-
- // benchmark wxWidgets implementation of wxSnprintf()
- wxStopWatch wx;
- for (int i=0; i < tests; i++)
- {
- DO_LONG_BENCHMARK(wxSnprintf)
- DO_BENCHMARK(wxSnprintf)
- }
- wx.Pause();
-
- // print results
- // ----------------------
-
- wxPrintf(wxT("\n ============================== RESULTS ==============================\n"));
- wxPrintf(wxT(" => Time for the system's snprintf(): %.5f microsec\n"), wxFMT(sys));
-#if wxSYSTEM_HAS_POSPARAM_SUPPORT
- wxPrintf(wxT(" => Time for the system's snprintf() with positionals: %.5f microsec\n"), wxFMT(sysPos));
-#endif
- wxPrintf(wxT(" => Time for wxSnprintf(): %.5f microsec\n"), wxFMT(wx));
-#if wxUSE_PRINTF_POS_PARAMS
- wxPrintf(wxT(" => Time for wxSnprintf() with positionals: %.5f microsec\n"), wxFMT(wxPos));