Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Parametres
Dim Stopwatch As System.Diagnostics.Stopwatch
Stopwatch = New Stopwatch
' Initialisation : debut de la mesure
Stopwatch.Start()
' Code à tester
'...
Dim i As Long, a As Long
For i = 1 To 100000000
a = a + 1
Next i
'...
' fin de la mesure
Stopwatch.Stop()
' Affichage de la mesure
MessageBox.Show(Stopwatch.Elapsed().TotalSeconds & " secondes")
'MessageBox.Show(Stopwatch.Elapsed().TotalMilliseconds & " millisecondes")
End Sub