You can also use the old school trace.
Dim ts = Stopwatch.StartNew ' Your code goes here ' Format and display the TimeSpan value. Dim elapsedTime As String = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10) Console.WriteLine( "RunTime " + elapsedTime)
source share