diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-04 13:54:57 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-04 13:54:57 +0100 |
commit | 7dd8b0cc0561c5fa0c9096b79fb7f0647b3470b4 (patch) | |
tree | 4d2d2bdc9f72ca401bd88894a9b040054f1c9149 /src | |
parent | 61279a1947328df0b8004edebcbe405ab7b1c09e (diff) |
Fix clock restart returning incorrect time
Diffstat (limited to 'src')
-rw-r--r-- | src/system/clock.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |