summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-07 17:54:36 +0200
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-07 17:54:36 +0200
commit45d1a969f70e1b127eb0aaab94dfce33b18e42ee (patch)
tree12bc0629c4f6d55d01fe8b335dc4320583c049c6 /src/timer.c
parent2289cde164c0270c8e60f185b20ba89c73707913 (diff)
work
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;
+}