From 7c59786e1caa59551e08f7b4c5a324de90d8c63d Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Thu, 9 Mar 2017 09:51:05 +0300 Subject: [PATCH] Added elapsed time info --- WhiteRabbit/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/WhiteRabbit/Program.cs b/WhiteRabbit/Program.cs index b5b8148..e6faae4 100644 --- a/WhiteRabbit/Program.cs +++ b/WhiteRabbit/Program.cs @@ -2,6 +2,7 @@ { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Numerics; using System.Security.Cryptography; @@ -17,6 +18,9 @@ /// public static void Main() { + var stopwatch = new Stopwatch(); + stopwatch.Start(); + var processor = new StringsProcessor("poultry outwits ants", 4); var expectedHashes = new[] { @@ -31,9 +35,12 @@ { if (expectedHashesAsVectors.Contains(result.Item2)) { - Console.WriteLine($"Found phrase: {result.Item1}"); + Console.WriteLine($"Found phrase: {result.Item1} (spent {stopwatch.Elapsed})"); } } + + stopwatch.Stop(); + Console.WriteLine($"Total time spent: {stopwatch.Elapsed}"); } // Code taken from http://stackoverflow.com/a/321404/831314