]> git.saurik.com Git - wxWidgets.git/commitdiff
add timing of synchronous execution
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Mar 2008 15:41:37 +0000 (15:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Mar 2008 15:41:37 +0000 (15:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/exec/exec.cpp

index add59464c91791b1a5380f6c941b18f57b1e1ff5..c8718837263b1e4af03d95bda3cd33272006d162 100644 (file)
@@ -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 )
         {