]> git.saurik.com Git - wxWidgets.git/commitdiff
add timing of the page loading (see #9972)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Mar 2009 13:00:42 +0000 (13:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Mar 2009 13:00:42 +0000 (13:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/html/test/test.cpp

index a0655c2d8471a54a1ad7b78709554b2f7d44137d..e30905a82b09a0d54a1ecd8cb1046e8d25095026 100644 (file)
@@ -30,6 +30,7 @@
 #include "wx/utils.h"
 #include "wx/clipbrd.h"
 #include "wx/dataobj.h"
+#include "wx/stopwatch.h"
 
 #include "../../sample.xpm"
 
@@ -192,7 +193,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     wxMenu *menuFile = new wxMenu;
     wxMenu *menuNav = new wxMenu;
 
-    menuFile->Append(ID_PageOpen, _("&Open HTML page..."));
+    menuFile->Append(ID_PageOpen, _("&Open HTML page...\tCtrl-O"));
     menuFile->Append(ID_DefaultLocalBrowser, _("&Open current page with default browser"));
     menuFile->Append(ID_DefaultWebBrowser, _("Open a &web page with default browser"));
     menuFile->AppendSeparator();
@@ -233,7 +234,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     m_Html = new MyHtmlWindow(this);
     m_Html->SetRelatedFrame(this, _("HTML : %s"));
 #if wxUSE_STATUSBAR
-    m_Html->SetRelatedStatusBar(0);
+    m_Html->SetRelatedStatusBar(1);
 #endif // wxUSE_STATUSBAR
     m_Html->ReadCustomization(wxConfig::Get());
     m_Html->LoadFile(wxFileName(wxT("test.htm")));
@@ -270,7 +271,15 @@ void MyFrame::OnPageOpen(wxCommandEvent& WXUNUSED(event))
         wxEmptyString, wxEmptyString, wxT("HTML files|*.htm;*.html"));
 
     if (!p.empty())
+    {
+#if wxUSE_STOPWATCH
+        wxStopWatch sw;
+#endif
         m_Html->LoadFile(wxFileName(p));
+#if wxUSE_STOPWATCH
+        wxLogStatus("Loaded \"%s\" in %lums", p, sw.Time());
+#endif
+    }
 #endif // wxUSE_FILEDLG
 }