chore: add timer
This commit is contained in:
+10
-3
@@ -1,4 +1,6 @@
|
|||||||
namespace IYGASAF;
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace IYGASAF;
|
||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
@@ -24,9 +26,14 @@ public class Program
|
|||||||
var almanac = Almanac.Parse(input);
|
var almanac = Almanac.Parse(input);
|
||||||
|
|
||||||
Console.WriteLine("Getting lowest seed location...");
|
Console.WriteLine("Getting lowest seed location...");
|
||||||
var result = almanac.GetLowestSeedLocation(seedsAreRanges);
|
|
||||||
|
|
||||||
Console.WriteLine($"The lowest seed location is {result}.");
|
var stopwatch = new Stopwatch();
|
||||||
|
stopwatch.Start();
|
||||||
|
var result = almanac.GetLowestSeedLocation(seedsAreRanges);
|
||||||
|
stopwatch.Stop();
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine($"The lowest seed location is {result}. ({stopwatch.ElapsedMilliseconds}ms)");
|
||||||
|
|
||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user