diff options
author | Marvin Borner | 2020-12-13 12:35:33 +0100 |
---|---|---|
committer | Marvin Borner | 2020-12-13 12:35:33 +0100 |
commit | fc4981e3ea863632c88e5f0b308ae4532d077e49 (patch) | |
tree | 811a1d2c09cd811764fb8c3c09099a876beb0e7f /2020/03 | |
parent | f476fb5eaf30254dcb9e480f27f52b207147e207 (diff) |
Added execution timers
Diffstat (limited to '2020/03')
-rw-r--r-- | 2020/03/solve.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/2020/03/solve.c b/2020/03/solve.c index 2f6312b..e427764 100644 --- a/2020/03/solve.c +++ b/2020/03/solve.c @@ -1,6 +1,6 @@ -#include <assert.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> int part_one(FILE *fp) { @@ -48,9 +48,12 @@ int main(int argc, char *argv[]) if (!fp) exit(EXIT_FAILURE); + clock_t tic = clock(); printf("%d\n", part_one(fp)); rewind(fp); printf("%u\n", part_two(fp)); + clock_t toc = clock(); + printf("TIME: %f seconds\n", (double)(toc - tic) / CLOCKS_PER_SEC); fclose(fp); return 0; |