コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: vinils/MyList1.Test
        public void ListFilesExecutionTime()
        {
            var dir        = new System.IO.DirectoryInfo("U:\\");
            var exceptions = new ConcurrentBag <Exception>();
            var timeBefore = DateTime.Now;

            dir.ListAllFilesParallel((file) => { }, exceptions.Add);

            var timeAfter = DateTime.Now;
            var timeDiff  = timeAfter - timeBefore;

            System.Diagnostics.Debug.WriteLine("Test: " + "ListFilesExecutionTime");
            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);
        }