BuildingCoder.JtTimer.Report C# (CSharp) Метод

Report() публичный Метод

Write and display a report of the timing results in a text file.
public Report ( string description ) : void
description string
Результат void
        public void Report( string description )
        {
            TimeRegistry.WriteResults( description, _duration );
        }

Usage Example

        void RunBenchmark()
        {
            // Create a number of levels for us to play with:

              int maxLevel = 1000;
              for( int i = 3; i < maxLevel; ++i )
              {
            CreateLevel( i );
              }

              // Run a specified number of tests
              // to retrieve all levels in different
              // ways:

              int nLevels = GetElementsOfType( typeof( Level ) )
            .ToElements().Count;

              int nRuns = 1000;

              JtTimer totalTimer = new JtTimer(
            "TOTAL TIME" );

              using( totalTimer )
              {
            for( int i = 0; i < nRuns; ++i )
            {
              BenchmarkAllLevels( nLevels );
            }
              }

              totalTimer.Report( "Retrieve all levels:" );

              // Run a specified number of tests
              // to retrieve a randomly selected
              // specific level:

              nRuns = 1000;
              Random rand = new Random();
              totalTimer.Restart( "TOTAL TIME" );

              using( totalTimer )
              {
            for( int i = 0; i < nRuns; ++i )
            {
              int iLevel = rand.Next( 1, maxLevel );
              BenchmarkSpecificLevel( iLevel );
            }
              }

              totalTimer.Report(
            "Retrieve specific named level:" );
        }
All Usage Examples Of BuildingCoder.JtTimer::Report