diff --git a/Qrakhen.Qamp.Core/Benchmark.cs b/Qrakhen.Qamp.Core/Benchmark.cs index 10e4708..5b3797d 100644 --- a/Qrakhen.Qamp.Core/Benchmark.cs +++ b/Qrakhen.Qamp.Core/Benchmark.cs @@ -60,16 +60,12 @@ public static class Benchmark string key = MakeKey(id, member, file); if (!_clocks.TryGetValue(key, out Stopwatch sw)) { -#if LOG - _logger.Debug($"No clock found for '{key}', start one first using Benchmark.Start()"); -#endif + _logger.Debug($"No clock found for '{key}', start one first using Benchmark.Start()"); return 0; } sw.Stop(); -#if LOG - _logger.Debug($" ::: {key}:{line} > {message ?? "Elapsed"}: {sw.Elapsed}"); -#endif + IO.Console.Write($" ::: {key}:{line} > {message ?? "Elapsed"}: {sw.Elapsed}"); if (keep) sw.Start(); diff --git a/Qrakhen.Qamp.Core/Compilation/Digester.cs b/Qrakhen.Qamp.Core/Compilation/Digester.cs index fcaf9b5..3118224 100644 --- a/Qrakhen.Qamp.Core/Compilation/Digester.cs +++ b/Qrakhen.Qamp.Core/Compilation/Digester.cs @@ -76,6 +76,8 @@ public class Digester : ISteppable public Function Digest() { + Benchmark.Active = true; + Benchmark.Start($"Digest begin"); #if LOG _logger.Method(); #endif @@ -101,6 +103,7 @@ public class Digester : ISteppable #if LOG _logger.Verbose(_debug.Debug()); #endif + Benchmark.End($"Digest end"); return function; }