add benchmark during digestion
This commit is contained in:
parent
d79cdf9c92
commit
3b50abebe4
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ public class Digester : ISteppable<Token>
|
|||
|
||||
public Function Digest()
|
||||
{
|
||||
Benchmark.Active = true;
|
||||
Benchmark.Start($"Digest begin");
|
||||
#if LOG
|
||||
_logger.Method();
|
||||
#endif
|
||||
|
|
@ -101,6 +103,7 @@ public class Digester : ISteppable<Token>
|
|||
#if LOG
|
||||
_logger.Verbose(_debug.Debug());
|
||||
#endif
|
||||
Benchmark.End($"Digest end");
|
||||
return function;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue