public void ListDirectoriesExecutionTime() { var dir = new System.IO.DirectoryInfo("U:\\"); var exceptions = new ConcurrentBag <Exception>(); var timeBefore = DateTime.Now; dir.ListAllParallel((localDir) => { }, exceptions.Add); var timeAfter = DateTime.Now; var timeDiff = timeAfter - timeBefore; System.Diagnostics.Debug.WriteLine("Test: " + "ListDirectoriesExecutionTime"); System.Diagnostics.Debug.WriteLine("Number of erros " + exceptions.Count); System.Diagnostics.Debug.WriteLine("Started at " + timeBefore); System.Diagnostics.Debug.WriteLine("Finished at " + timeAfter); System.Diagnostics.Debug.WriteLine("Diff " + timeDiff); }