From 223867913bcf4e52a29a5ef75683c731cacb5f22 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Mar 2008 15:41:37 +0000 Subject: [PATCH] add timing of synchronous execution git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/exec/exec.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index add59464c9..c871883726 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -53,6 +53,7 @@ #include "wx/numdlg.h" #include "wx/textdlg.h" #include "wx/ffile.h" +#include "wx/stopwatch.h" #include "wx/process.h" @@ -762,13 +763,15 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) if ( sync ) { - wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() ); + wxLogStatus("\"%s\" is running please wait...", cmd); + + wxStopWatch sw; wxArrayString output, errors; int code = wxExecute(cmd, output, errors); - wxLogStatus(_T("Command '%s' terminated with exit code %d."), - cmd.c_str(), code); + wxLogStatus("Command \"%s\" terminated after %ldms; exit code %d.", + cmd, sw.Time(), code); if ( code != -1 ) { -- 2.45.2