AoC2024_Java/src/Main.java

34 lines
1.4 KiB
Java
Raw Normal View History

2024-12-01 23:55:21 +00:00
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)", d1_p2_answer, day01_p2);
}
}