feat: lunadbg GDB plugin to ease kernel debugging process.
[lunaix-os.git] / lunaix-os / kernel / time / clock.c
index 2bf61d4f48700fed442252b8a694c51c15598405..3170731b842c340398227f33f898a61e2baf4060 100644 (file)
@@ -67,7 +67,12 @@ clock_systime()
 
     ticks_t t = hwtimer_current_systicks();
     ticks_t tu = systimer->running_freq / 1000;
-    return t / (tu + 1);
+
+    if (unlikely(!tu)) {
+        return t;
+    }
+
+    return t / (tu);
 }
 
 void