added timers to auto-hide help and for counting the time it took to solve the puzzle

This commit is contained in:
2023-11-17 06:16:32 +02:00
parent be4df6685c
commit 77435c5095
10 changed files with 241 additions and 47 deletions
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include <sys/time.h>
extern struct timeval start_time;
typedef struct Timer {
float time;
float duration;
bool is_running;
} Timer;
double get_time();
void start_internal_timer();
bool timer_ended(Timer *timer);
void timer_start(Timer *timer, float duration);
void timer_reset(Timer *timer);
float timer_remaining(Timer *timer);
void timer_stop(Timer *timer);
float timer_elapsed(Timer *timer);