aboutsummaryrefslogtreecommitdiffstats
path: root/src/wiring/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wiring/time.h')
-rw-r--r--src/wiring/time.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/wiring/time.h b/src/wiring/time.h
new file mode 100644
index 0000000..694545b
--- /dev/null
+++ b/src/wiring/time.h
@@ -0,0 +1,27 @@
+#ifndef _TIME_H
+#define _TIME_H
+
+#include <inttypes.h>
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+/* Returns time since boot in milliseconds */
+uint32_t millis(void);
+
+/* Time in microseconds since boot */
+uint32_t micros(void);
+
+/* Delay for ms milliseconds */
+void delay(unsigned long ms);
+
+/* Delay for us microseconds */
+void delayMicroseconds(uint32_t us);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+
+#endif
+