From d26a89b8ab74ef8e1e1261d4b6ffd3ed07b718a0 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 25 Aug 2021 20:25:45 -0700 Subject: [PATCH] Add time elapsed to debug output --- BurnOutSharp/Scanner.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index aeb2aa67..a0d1d71e 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -71,6 +71,9 @@ namespace BurnOutSharp if (paths == null || !paths.Any()) return null; + // Set a starting starting time for debug output + DateTime startTime = DateTime.UtcNow; + // Checkpoint FileProgress?.Report(new ProtectionProgress(null, 0, null)); @@ -175,6 +178,10 @@ namespace BurnOutSharp // Clear out any empty keys Utilities.ClearEmptyKeys(protections); + // If we're in debug, output the elasped time to console + if (IncludeDebug) + Console.WriteLine($"Time elapsed: {DateTime.UtcNow.Subtract(startTime)}"); + return protections; }