[chronojump/FS-TFT-Menu] ChronoDebug method to know time from Start to End



commit 70723fd8e0fe75907935e643f946044cdd754c42
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 29 19:26:55 2022 +0200

    ChronoDebug method to know time from Start to End

 src/chronoDebug.cs | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/chronoDebug.cs b/src/chronoDebug.cs
index a4ed85c18..a813ee2cb 100644
--- a/src/chronoDebug.cs
+++ b/src/chronoDebug.cs
@@ -41,6 +41,10 @@ public class ChronoDebugAction
        {
                return string.Format("action: {0}, ms: {1}", action, elapsedMs);
        }
+
+       public int ElapsedMs {
+               get { return elapsedMs; }
+       }
 }
 
 public class ChronoDebug
@@ -89,5 +93,16 @@ public class ChronoDebug
                foreach(ChronoDebugAction action in list)
                        LogB.Information(action.ToString());
        }
+
+       //Note this only works properly if there are just these two moments
+       public int StartToEndInMs ()
+       {
+               if(list.Count == 0)
+                       return 0;
+
+               //Start is ms 1
+               ChronoDebugAction actionStop = list[list.Count -1];
+               return actionStop.ElapsedMs;
+       }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]