From 5f944717972b5b94a3e76d817d0ad9155e21754c Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:45:12 -0600 Subject: [PATCH] chore: add timer --- 05/IYGASAF/Program.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/05/IYGASAF/Program.cs b/05/IYGASAF/Program.cs index de90804..bacb027 100644 --- a/05/IYGASAF/Program.cs +++ b/05/IYGASAF/Program.cs @@ -1,4 +1,6 @@ -namespace IYGASAF; +using System.Diagnostics; + +namespace IYGASAF; public class Program { @@ -24,9 +26,14 @@ public class Program var almanac = Almanac.Parse(input); 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; }