From a49ac0db93bcc3fe554b7a625e4275c38788a533 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 18 Jun 2023 18:04:49 +0200 Subject: [PATCH] timespec_to_sec now first multiplies tv_nsec by 1E-09 to convert to seconds --- src/engine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine.c b/src/engine.c index 6e460dd..a8ab0a2 100644 --- a/src/engine.c +++ b/src/engine.c @@ -13,7 +13,7 @@ static struct timespec start_last_frame; inline static double timespec_to_sec(struct timespec spec) { - return spec.tv_sec + spec.tv_nsec; + return spec.tv_sec + spec.tv_nsec * 1E-09f; } inline float delta_time() {