Пример #1
0
 public static void DoBenchmark()
 {
     Timer t = new Timer();
     
     //~ t.Start();
     //~ for( int i = 0; i < NumIterations; i++ )
     //~ {
         //~ ReferenceCounted rc = new ReferenceCounted();
         //~ rc.Method();            
     //~ }
     //~ t.End();
     //~ Console.WriteLine( "Reference counted: {0}", t.Interval );
     
     t.Start();
     for( int i = 0; i < NumIterations; i++ )
     {
         TracingGC gc = new TracingGC();
         gc.Method();            
     }
     t.End();
     Console.WriteLine( "Tracing GC: {0}", t.Interval );
 }    
Пример #2
0
    public static void DoBenchmark()
    {
        Timer t = new Timer();

        //~ t.Start();
        //~ for( int i = 0; i < NumIterations; i++ )
        //~ {
        //~ ReferenceCounted rc = new ReferenceCounted();
        //~ rc.Method();
        //~ }
        //~ t.End();
        //~ Console.WriteLine( "Reference counted: {0}", t.Interval );

        t.Start();
        for (int i = 0; i < NumIterations; i++)
        {
            TracingGC gc = new TracingGC();
            gc.Method();
        }
        t.End();
        Console.WriteLine("Tracing GC: {0}", t.Interval);
    }