[chronojump] restTime TotalMinutes as double



commit f9f8778f3087e64e2a7c2dae83f0dd3b14343929
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Sep 19 13:13:04 2017 +0200

    restTime TotalMinutes as double

 src/restTime.cs |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/restTime.cs b/src/restTime.cs
index 6d2586e..bd0982a 100644
--- a/src/restTime.cs
+++ b/src/restTime.cs
@@ -68,10 +68,11 @@ public class LastTestTime
                }
        }
 
-       public int GetTotalMinutes()
+       //better a double because an int on > 30" marks as 1 minute
+       public double GetTotalMinutes()
        {
                TimeSpan ts = DateTime.Now.Subtract(time);
-               return Convert.ToInt32(ts.TotalMinutes);
+               return ts.TotalMinutes;
        }
 
        public static int GetSeconds(string restedTime)
@@ -203,7 +204,7 @@ public class RestTime
                //remove reverse in order to not hung the program on removing while iteratin
                for (int i = listLastMin.Count - 1; i >= 0; i--)
                {
-                       if(listLastMin[i].GetTotalMinutes() > 9 )//10 minutes
+                       if(listLastMin[i].GetTotalMinutes() > 10 )//10 minutes
                                listLastMin.RemoveAt(i);
                }
 


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