From f76474001b5b08fed82f79acf5fdba180a4d8dbd Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Mon, 4 Dec 2023 23:34:12 +1100 Subject: [PATCH] Added clock function for epeen --- day2/puzzle2/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/day2/puzzle2/main.c b/day2/puzzle2/main.c index f85c999..b665138 100644 --- a/day2/puzzle2/main.c +++ b/day2/puzzle2/main.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -121,6 +122,7 @@ int get_id(char *ptr) int main() { + clock_t begin = clock(); struct Games games; games.iterator = 0; int MAX_RED = 12; @@ -216,6 +218,8 @@ int main() printf("Unmapping failed"); return 1; } - + clock_t end = clock(); + double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; + printf("%f", time_spent); return 0; }