Use Stopwatch : Stopwatch « Development Class « C# / C Sharp






Use Stopwatch

 

using System;
using System.Reflection;
using System.Diagnostics;

class OnlyLoad {
    static void Main() {
        Stopwatch duration = new Stopwatch();
        duration.Reset();
        duration.Start();
        Assembly a = Assembly.Load("library");
        duration.Stop();
        Console.WriteLine(duration.ElapsedTicks.ToString());
        duration.Reset();
        duration.Start();
        a = Assembly.ReflectionOnlyLoad("library");
        duration.Stop();
        Console.WriteLine(duration.ElapsedTicks.ToString());
    }
}
           
         
  








Related examples in the same category

1.Stopwatch utilities