From d33610fe6737513e400c45cdc52e80ca8511c8a2 Mon Sep 17 00:00:00 2001 From: Tobias Linz Date: Thu, 19 Nov 2026 10:30:40 +0100 Subject: [PATCH] Fix timer --- Startcode/timer.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/Startcode/timer.c b/Startcode/timer.c index fd8f6c1..40b67c3 100644 --- a/Startcode/timer.c +++ b/Startcode/timer.c @@ -1,7 +1,7 @@ #include "timer.h" -#if __APPLE__ -#include +#include + static struct timespec start = {0, 0}; // Starts the timer. @@ -30,26 +30,3 @@ double stopTimer() return measuredSeconds; } -#else -#include -static clock_t startClocks = 0; - -// Starts the timer. -void startTimer() -{ - startClocks = clock(); -} - -// Returns the time in seconds since startTimer() was called. -double stopTimer() -{ - double measuredSeconds = (clock() - (double)startClocks) / CLOCKS_PER_SEC; - - if(startClocks > 0) - startClocks = 0; - else - measuredSeconds = -1; - - return measuredSeconds; -} -#endif \ No newline at end of file