From 949217e4f83c11b09dbe2c304108c9b0599f03ff Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Mon, 20 Jun 2022 02:55:59 +0100 Subject: [PATCH] Add performance monitoring for file listing function --- Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Program.cs b/Program.cs index c7a1032..33d1250 100644 --- a/Program.cs +++ b/Program.cs @@ -86,6 +86,8 @@ class Program dirs.Push(directory); Log.Debug("Dirs Starting as: {DirStack}",dirs ); + Stopwatch timer = new(); + timer.Start(); while (dirs.Count > 0) { @@ -107,6 +109,8 @@ class Program Log.Debug("Adding Directory {subdir} to dirs\nResult: {dirs}",subdir,dirs); } } + timer.Stop(); + Log.Information("Crawled {directory} in {time}ms with {number} results",directory,timer.ElapsedMilliseconds,res.Count()); return res; }