Calculating hard drive throughput
My app creates a 2GB file and needs to select the fastest drive on the system with enough space. I am trying to calculate throughput by creating the file, setting the length, then writing data to it sequentially as follows: FileInfo file = null; var drives = DriveInfo.GetDrives(); var stats = new List<DriveInfoStatistics>(); foreach (var drive in drives) { do { file = new FileInfo(Path.Combine(drive.RootDirectory.FullName, Guid.NewGuid().ToString("D") + ".tmp")); } while (file.Exists); try { using (var stream = file.Open(FileMode.CreateNew, FileAccess.Write, FileShare.None)) { var seconds = 10