Split timer into header and implementation file

This commit is contained in:
2024-03-08 23:33:24 -05:00
parent 352d3f26f1
commit 1423cc19a0
2 changed files with 31 additions and 19 deletions

19
timer.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdbool.h>
#include "includes/timer.h"
#include "includes/raygui/raygui.h"
Timer timer_init(double lifetime_secs) {
Timer timer;
timer.start_time = GetTime();
timer.lifetime = lifetime_secs;
return timer;
}
bool timer_done(Timer timer) {
return GetTime() - timer.start_time >= timer.lifetime;
}
double timer_get_elapsed(Timer timer) {
return GetTime() - timer.start_time;
}