d544a7b5c7
Signed-off-by: Eoghan Conlon <git@eoghanconlon.ie>
60 lines
2.5 KiB
Java
60 lines
2.5 KiB
Java
import java.io.IOException;
|
|
|
|
public class Main {
|
|
public static void main(String[] args) throws IOException {
|
|
System.out.println("Advent of Code 2024");
|
|
System.out.println("Day 1:");
|
|
long start = System.currentTimeMillis();
|
|
Day01 day01 = new Day01();
|
|
long day01_init = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int sample_d1_p1_answer = day01.Part1_sample();
|
|
long day01_p1_sample = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d1_p1_answer = day01.Part1();
|
|
long day01_p1 = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int sample_d1_p2_answer = day01.Part2_Sample();
|
|
long day01_p2_sample = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d1_p2_answer = day01.Part2();
|
|
long day01_p2 = System.currentTimeMillis() - start;
|
|
|
|
System.out.printf("Day 1 init took %dms", day01_init);
|
|
System.out.printf("Part 1 sample is: %d (%dms)\n", sample_d1_p1_answer, day01_p1_sample);
|
|
System.out.printf("Part 1 answer is: %d (%dms)\n", d1_p1_answer, day01_p1);
|
|
System.out.printf("Part 2 sample answer is: %d (%dms)\n", sample_d1_p2_answer, day01_p2_sample);
|
|
System.out.printf("Part 2 answer is: %d (%dms)\n", d1_p2_answer, day01_p2);
|
|
|
|
System.out.println("\nDay 2:");
|
|
start = System.currentTimeMillis();
|
|
Day02 day02 = new Day02();
|
|
long day02_init = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d2_p1_sample = day02.part1Sample();
|
|
long day02_p1_sample = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d2_p1 = day02.part1();
|
|
long day02_p1 = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d2_p2_sample = day02.part2Sample();
|
|
long day02_p2_sample = System.currentTimeMillis() - start;
|
|
|
|
start = System.currentTimeMillis();
|
|
int d2_p2 = day02.part2();
|
|
long day02_p2 = System.currentTimeMillis() - start;
|
|
|
|
System.out.printf("Day 2 init took %dms\n", day02_init);
|
|
System.out.printf("Part 1 sample = %d (%dms)\n", d2_p1_sample, day02_p1_sample);
|
|
System.out.printf("Part 1 answer = %d (%dms)\n", d2_p1, day02_p1);
|
|
System.out.printf("Part 2 sample = %d (%dms)\n", d2_p2_sample, day02_p2_sample);
|
|
System.out.printf("Part 2 answer = %d (%dms)\n", d2_p2, day02_p2);
|
|
}
|
|
}
|