VB.net Program to Print the Elapsed Milliseconds of Stopwatch Using Thread.sleep() Method

You are currently viewing VB.net Program to Print the Elapsed Milliseconds of Stopwatch Using Thread.sleep() Method

VB.Net program to print the elapsed milliseconds of stopwatch using Thread.Sleep() method

'Vb.Net program to print the elapsed milliseconds of 
'stopwatch using Thread.Sleep() method.

Imports System.Threading

Module Module1
    Sub Main()
        Dim watch As Stopwatch = Stopwatch.StartNew()

        Thread.Sleep(2000)
        watch.Stop()

        Console.WriteLine("Elapsed Milliseconds by ThreadSleep() : {0}", watch.ElapsedMilliseconds)
    End Sub
End Module
Elapsed Milliseconds by ThreadSleep() : 2007
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply