Calculer le temps d'exécution d'une méthode
using System.Diagnostics; Stopwatch sw = new Stopwatch(); sw.Start(); « La méthode à exécuter » sw.Stop(); Console.WriteLine("Temps d'éxécution : " + sw.Elapsed.Minutes + " minutes, " + sw.Elapsed.Seconds + " secondes, " + sw.Elapsed.Milliseconds + " milliseconds");