/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/05 01:54:33	285
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/05 02:19:13	286
@@ -917,6 +917,9 @@
 
         private void SearchWorkerThread_DoWork(object sender, DoWorkEventArgs e)
         {
+            Stopwatch st = new Stopwatch();
+            st.Start();
+            e.Result = st;
             //List<ResultType<object>> tmp_Results = new List<ResultType<object>>();
             List<ResultType<object>> second_tmp_Results = new List<ResultType<object>>();
             const double _UPDATE_DELAY = 1024.0;
@@ -1316,13 +1319,20 @@
 
         private void SearchWorkerThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
+            if (!e.Cancelled)
+            {
+                Stopwatch st = (e.Result as Stopwatch);
+                st.Stop();
+                logger.Debug.WriteLine("Search took a total of {0} seconds", st.Elapsed.TotalSeconds);
+            }
+            
             resultsprogress.Value = 100;
-            logger.Debug.WriteLine(string.Format("\nResults Count -> 0x{0:x8}", SearchArgs.Results.Count));
+            logger.Debug.WriteLine(string.Format("Results Count -> 0x{0:x8}", SearchArgs.Results.Count));
 
             if (SearchArgs.Results.Count == 1) // debug message for 1 result using 32bit unsigned
-                logger.Debug.WriteLine(string.Format("\nDebug: Found 1 result -> Address: 0x{0:x8} Value: 0x{1:x8}", SearchArgs.Results[0].Address, SearchArgs.Results[0].Value));
+                logger.Debug.WriteLine(string.Format("Debug: Found 1 result -> Address: 0x{0:x8} Value: 0x{1:x8}", SearchArgs.Results[0].Address, SearchArgs.Results[0].Value));
 
-           logger.Info.WriteLine(string.Format("\nFound 0x{0:x8} results", SearchArgs.Results.Count));
+           logger.Info.WriteLine(string.Format("Found 0x{0:x8} results", SearchArgs.Results.Count));
 
             if (SearchArgs.Results.Count <= MIN_NUMBER_OF_RESULTS_BEFORE_DISPLAY)
             {

 

  ViewVC Help
Powered by ViewVC 1.1.22