#ifdef __cplusplus extern "C" { #endif #ifndef _TIMER_H #define _TIMER_H #include /* This file defines a simple timer Types, and declares functions to initialize it, and keep track of time elapsed. The actual definition of the Timer struct is in timer.c It was copied from https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions#how-do-i-make-a-timer */ typedef struct Timer_s { double start_time; // Start time (seconds) double lifetime; // Lifetime (seconds) } Timer; /* Starts a timer for given number of seconds */ Timer timer_init(double lifetime_secs); /* Returns true when timer finishes, false if not */ bool timer_done(Timer timer); /* Returns amount of time elapsed since start of timer */ double timer_get_elapsed(Timer timer); #endif #ifdef __cplusplus } #endif