Skip to content

Commit 660660f

Browse files
committed
Remove timers
1 parent bb697d6 commit 660660f

File tree

5 files changed

+5
-34
lines changed

5 files changed

+5
-34
lines changed

Makefile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ all: \
66
emulate \
77
intcode \
88
day02a day02b \
9-
day05a day05b \
109
day07a day07b \
11-
day09a day09b \
10+
day09b \
1211
day10a \
1312
day11a day11b \
1413
day12a day12b \
@@ -46,21 +45,12 @@ day02a: src/day02a.c emulator parser
4645
day02b: src/day02b.c emulator parser
4746
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o
4847

49-
day05a: src/day05a.c emulator parser
50-
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o
51-
52-
day05b: src/day05b.c emulator parser
53-
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o
54-
5548
day07a: src/day07a.c emulator parser permutation_iterator
5649
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o permutation_iterator.o
5750

5851
day07b: src/day07b.c emulator parser permutation_iterator
5952
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o permutation_iterator.o
6053

61-
day09a: src/day09a.c
62-
$(CC) $(CFLAGS) $< -o $@.o $(LIBM)
63-
6454
day09b: src/day09b.c
6555
$(CC) $(CFLAGS) $< -o $@.o $(LIBM)
6656

src/day02a.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
// 1202 Program Alarm Part 1
66

7-
#include <time.h>
87
#include "../lib/emulator.h"
98
#include "../lib/parser.h"
109
#define MEMORY 256
@@ -13,7 +12,6 @@ int main(void)
1312
{
1413
Word memory[MEMORY];
1514
struct Emulator processor;
16-
clock_t start = clock();
1715

1816
parser_parse(stdin, memory);
1917

@@ -22,10 +20,7 @@ int main(void)
2220

2321
emulator(&processor, memory);
2422
emulator_execute(&processor);
25-
printf(
26-
"02a " WORD_FORMAT " %lf\n",
27-
memory[0],
28-
(double)(clock() - start) / CLOCKS_PER_SEC);
23+
printf("02a " WORD_FORMAT "\n", memory[0]);
2924

3025
return 0;
3126
}

src/day02b.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
// 1202 Program Alarm Part 2
66

7-
#include <time.h>
87
#include "../lib/emulator.h"
98
#include "../lib/parser.h"
109
#define MEMORY 256
@@ -40,13 +39,9 @@ static Word scan(Word image[], int imageSize)
4039
int main(void)
4140
{
4241
Word image[MEMORY];
43-
clock_t start = clock();
4442
Word product = scan(image, parser_parse(stdin, image));
4543

46-
printf(
47-
"02b " WORD_FORMAT " %lf\n",
48-
product,
49-
(double)(clock() - start) / CLOCKS_PER_SEC);
44+
printf("02b " WORD_FORMAT "\n", product);
5045

5146
return 0;
5247
}

src/day07a.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Amplification Circuit Part 1
66

77
#include <string.h>
8-
#include <time.h>
98
#include "../lib/emulator.h"
109
#include "../lib/parser.h"
1110
#include "../lib/permutation_iterator.h"
@@ -23,7 +22,6 @@ int main()
2322
struct PermutationIterator iter;
2423
struct Emulator amplifiers[5];
2524
int set[] = { 0, 1, 2, 3, 4 };
26-
clock_t start = clock();
2725
int size = parser_parse(stdin, image);
2826

2927
for (int i = 0; i < 5; i++)
@@ -53,10 +51,7 @@ int main()
5351
}
5452
}
5553

56-
printf(
57-
"07a " WORD_FORMAT " %lf\n",
58-
max,
59-
(double)(clock() - start) / CLOCKS_PER_SEC);
54+
printf("07a " WORD_FORMAT "\n", max);
6055

6156
return 0;
6257
}

src/day07b.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ int main()
8484
struct PermutationIterator iter;
8585
struct Emulator amplifiers[5];
8686
int set[] = { 5, 6, 7, 8, 9 };
87-
clock_t start = clock();
8887
int imageSize = parser_parse(stdin, image);
8988

9089
for (int i = 0; i < 5; i++)
@@ -127,10 +126,7 @@ int main()
127126
}
128127
}
129128

130-
printf(
131-
"07b " WORD_FORMAT " %lf\n",
132-
max,
133-
(double)(clock() - start) / CLOCKS_PER_SEC);
129+
printf("07b " WORD_FORMAT "\n", max);
134130

135131
return 0;
136132
}

0 commit comments

Comments
 (0)