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; }