aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/include/emscripten/emscripten.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index b6e6307b..fb456d67 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -227,7 +227,14 @@ void emscripten_get_canvas_size(int *width, int *height, int *isFullscreen);
* absolute time, and is only meaningful in comparison to
* other calls to this function. The unit is ms.
*/
+#if EMSCRIPTEN
double emscripten_get_now();
+#else
+#include <time.h>
+double emscripten_get_now() {
+ return (1000*clock())/(double)CLOCKS_PER_SEC;
+}
+#endif
/*
* Simple random number generation in [0, 1), maps to Math.random().