VB.net Program to Pause a Thread

You are currently viewing VB.net Program to Pause a Thread

VB.Net program to Pause a Thread

'Program to Pause a Thread in VB.Net

Imports System.Threading

Module Module1
    Sub Main()
        For loopVar = 1 To 5 Step 1
            Console.WriteLine("Sleep Main thread for 1 Second")
            Thread.Sleep(1000)
        Next

        Console.WriteLine("Main thread Finished")
    End Sub
End Module
Sleep Main thread for 1 Second
Sleep Main thread for 1 Second
Sleep Main thread for 1 Second
Sleep Main thread for 1 Second
Sleep Main thread for 1 Second
Main thread Finished
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