aboutsummaryrefslogtreecommitdiff
path: root/2020/13
diff options
context:
space:
mode:
authorMarvin Borner2020-12-13 12:35:33 +0100
committerMarvin Borner2020-12-13 12:35:33 +0100
commitfc4981e3ea863632c88e5f0b308ae4532d077e49 (patch)
tree811a1d2c09cd811764fb8c3c09099a876beb0e7f /2020/13
parentf476fb5eaf30254dcb9e480f27f52b207147e207 (diff)
Added execution timers
Diffstat (limited to '2020/13')
-rw-r--r--2020/13/solve.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/2020/13/solve.c b/2020/13/solve.c
index dde2ed1..5cb45d1 100644
--- a/2020/13/solve.c
+++ b/2020/13/solve.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <time.h>
int part_one(char *data)
{
@@ -78,8 +78,11 @@ int main(int argc, char *argv[])
char buf[SIZE] = { 0 };
fread(buf, SIZE, 1, fp);
+ clock_t tic = clock();
printf("%d\n", part_one(buf));
printf("%lu\n", part_two(buf));
+ clock_t toc = clock();
+ printf("TIME: %f seconds\n", (double)(toc - tic) / CLOCKS_PER_SEC);
fclose(fp);
return 0;