summaryrefslogtreecommitdiffstats
path: root/system/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'system/timer.c')
-rw-r--r--system/timer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/timer.c b/system/timer.c
new file mode 100644
index 0000000..847cfb0
--- /dev/null
+++ b/system/timer.c
@@ -0,0 +1,9 @@
+#include <timer.h>
+#include <system.h>
+
+TIMER timers = {0};
+
+void sleep(unsigned long ms) {
+ timers.time = (ms + 9)/10;
+ while(timers.time) asm("incl %0; decl %0" : "+m" (timers.time));
+}