Use a more precise mechanism to measure elapsed times in operations.

This commit is contained in:
2023-09-26 20:16:24 +01:00
parent 8786474169
commit 09a5c00891
38 changed files with 692 additions and 597 deletions

View File

@@ -33,7 +33,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
@@ -115,6 +115,12 @@ public partial class Dump
bool _supportsPlextorD8;
bool _useBufferedReads;
static readonly TimeSpan _oneSecond = 1.Seconds();
readonly Stopwatch _dumpStopwatch;
readonly Stopwatch _sidecarStopwatch;
readonly Stopwatch _speedStopwatch;
readonly Stopwatch _trimStopwatch;
readonly Stopwatch _writeStopwatch;
readonly Stopwatch _imageCloseStopwatch;
/// <summary>Initializes dumpers</summary>
/// <param name="doResume">Should resume?</param>
@@ -207,6 +213,12 @@ public partial class Dump
_ignoreCdrRunOuts = ignoreCdrRunOuts;
_createGraph = createGraph;
_dimensions = dimensions;
_dumpStopwatch = new Stopwatch();
_sidecarStopwatch = new Stopwatch();
_speedStopwatch = new Stopwatch();
_trimStopwatch = new Stopwatch();
_writeStopwatch = new Stopwatch();
_imageCloseStopwatch = new Stopwatch();
}
/// <summary>Starts dumping with the established fields and autodetecting the device type</summary>