public static long Run(IPerformanceTest test) {
     test.Before();
     _stopwatch.Reset();
     _stopwatch.Start();
     test.Run();
     _stopwatch.Stop();
     return _stopwatch.ElapsedMilliseconds;
 }
 public static long Run(IPerformanceTest test)
 {
     test.Before();
     _stopwatch.Reset();
     _stopwatch.Start();
     test.Run();
     _stopwatch.Stop();
     return(_stopwatch.ElapsedMilliseconds);
 }
Example #3
0
 public static long Run(IPerformanceTest test)
 {
     test.Before();
     STOPWATCH.Reset();
     STOPWATCH.Start();
     test.Run();
     STOPWATCH.Stop();
     return(STOPWATCH.ElapsedMilliseconds);
 }
Example #4
0
        public static Tuple <long, long> Run(IPerformanceTest test)
        {
            test.Before();
            _stopwatch.Reset();
            var bytesBefore = MemoryHelper.GetMemoryStats(MemoryHelper.CurProcess);

            _stopwatch.Start();
            test.Run();
            _stopwatch.Stop();
            var bytesAfter = MemoryHelper.GetMemoryStats(MemoryHelper.CurProcess);
            // only GC memory shows some differences...
            long memoryDiff = bytesAfter[0] - bytesBefore[0];

            return(new Tuple <long, long>(_stopwatch.ElapsedMilliseconds, memoryDiff));
        }