From 7dd8b0cc0561c5fa0c9096b79fb7f0647b3470b4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 4 Nov 2021 13:54:57 +0100 Subject: Fix clock restart returning incorrect time --- src/system/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/system/clock.c b/src/system/clock.c index 3ec2276..52869b4 100644 --- a/src/system/clock.c +++ b/src/system/clock.c @@ -17,7 +17,7 @@ void mgl_clock_init(mgl_clock *self) { double mgl_clock_restart(mgl_clock *self) { const double new_time_seconds = clock_get_monotonic_seconds(); - const double elapsed_time_seconds = self->captured_seconds - new_time_seconds; + const double elapsed_time_seconds = new_time_seconds - self->captured_seconds; self->captured_seconds = new_time_seconds; return elapsed_time_seconds; } -- cgit v1.2.3