Stopwatch handling
@@ -59,10 +59,12 @@ namespace MiningCore.Extensions
{
using (var con = factory.OpenConnection())
{
+ sw.Reset();
sw.Start();
+
action(con);
- sw.Start();
+ sw.Stop();
logger.Debug(()=> $"Query took {sw.ElapsedMilliseconds} ms");
}
}
@@ -75,10 +77,12 @@ namespace MiningCore.Extensions
{
using (var con = factory.OpenConnection())
{
+ sw.Reset();
sw.Start();
+
var result = action(con);
- sw.Start();
+ sw.Stop();
logger.Debug(() => $"Query took {sw.ElapsedMilliseconds} ms");
return result;
}
