summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/timer.c b/src/timer.c
new file mode 100644
index 0000000..41904b0
--- /dev/null
+++ b/src/timer.c
@@ -0,0 +1,12 @@
+/*
+* BSD 2-Clause “Simplified” License
+* Copyright (c) 2019, Aldrik Ramaekers, aldrik.ramaekers@protonmail.com
+* All rights reserved.
+*/
+
+float32 timer_elapsed_ms(u64 start)
+{
+ u64 diff = platform_get_time(TIME_FULL, TIME_US) - start;
+ float diff_ms = diff / 1000.0f;
+ return diff_ms;
+}