Timer for accumulating 10 ms intervals that does not overflow after ~30 min

This class simply creates a timer that accumulates 10 millisecond intervals which does not overflow after about 30 min.

Revision:
0:21dc6ad1a795
Child:
1:134292d456c9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RunTimer.cpp	Thu May 19 13:37:02 2016 +0000
@@ -0,0 +1,39 @@
+#include "RunTimer.h"
+
+RunTimer::RunTimer(){
+    this->ms=0;
+    this->sec =0;
+    this->min = 0;
+    this->hour = 0;
+    this->days = 0;
+    
+    this->timer_10ms.attach(this, &RunTimer::timeAcc, .01);
+}
+
+void RunTimer::timeAcc(void){
+    this->ms +=10;
+    if(this->ms == 1000){
+        this->ms = 0;
+        this->sec++;
+        if(this->sec==60){
+            this->sec=0;
+            this->min++;
+            if(this->min == 60){
+                this->min=0;
+                this->hour++;
+                if(this->hour==24){
+                    this->hour=0;
+                    days++;
+                }
+            }
+        }    
+    }
+}//timeAcc
+
+void RunTimer::Reset(void){
+    this->T_ms=0;
+    this->T_sec =0;
+    this->T_min = 0;
+    this->T_hour = 0;
+    this->T_days = 0;
+}
\ No newline at end of file