-
Notifications
You must be signed in to change notification settings - Fork 0
/
Base.cs
41 lines (39 loc) · 1.21 KB
/
Base.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace AOC2021
{
public abstract class Base
{
public abstract void Part1();
public abstract void Part2();
public void HandleSelect()
{
var watch = new Stopwatch();
// the code that you want to measure comes here
watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds;
Console.WriteLine("Do you want to solve Part 1 or 2?");
switch (Console.ReadLine())
{
case "1":
watch.Start();
Part1();
watch.Stop();
Console.WriteLine("Time to solve: " + watch.ElapsedMilliseconds + "ms");
break;
case "2":
watch.Start();
Part2();
watch.Stop();
Console.WriteLine("Time to solve: " + watch.ElapsedMilliseconds);
break;
default:
Console.WriteLine($"Not implemented");
HandleSelect();
break;
}
}
}
}