summaryrefslogtreecommitdiff
path: root/src/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'src/rendering')
-rw-r--r--src/rendering/src/window.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rendering/src/window.c b/src/rendering/src/window.c
index 8514bb4..5bb01b0 100644
--- a/src/rendering/src/window.c
+++ b/src/rendering/src/window.c
@@ -66,18 +66,18 @@ static inline u64 glfw_gettime_msec() {
}
/* Should honestly just write my own */
-static inline u64 glfw_gettime_nsec() {
- return (f64)glfwGetTime() * 1000000000;
+static inline u64 glfw_gettime_usec() {
+ return (f64)glfwGetTime() * 1000000;
}
-static inline u64 platform_get_time() {
+static inline u64 platform_get_time_usec() {
struct timespec t;
int res = clock_gettime(CLOCK_MONOTONIC, &t);
if (res != 0) {
// TODO: Check errno
WARN("Failed to get system time");
}
- return t.tv_sec * 1000000000 + t.tv_nsec;
+ return (t.tv_sec * 1000000) + (t.tv_nsec / 1000);
}
Window* init_window_glfw(
@@ -145,7 +145,8 @@ Window* init_window_glfw(
ret->context = NULL;
window_poll_events = &glfwPollEvents;
- get_time = &platform_get_time;
+ //get_time = &platform_get_time_usec;
+ get_time = &platform_get_time_usec;
return ret;
}