[chronojump] ChronoDebug method to know time from Start to End
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ChronoDebug method to know time from Start to End
- Date: Fri, 29 Apr 2022 17:30:49 +0000 (UTC)
commit a0aec742fb94cdb411f1bf2d8fe45f2367eccba2
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]