Imports System.Threading
Module Module1
Sub TaskA()
Dim I As Integer
Thread.Sleep(1000)
For I = 0 To 250
System.Console.Write("A")
Next
End Sub
Sub TaskB()
Dim I As Integer
Thread.Sleep(500)
For I = 0 To 250
System.Console.Write("B")
Next
End Sub
Sub TaskC()
Dim I As Integer
Thread.Sleep(100)
For I = 0 To 250
System.Console.Write("C")
Next
End Sub
Sub Main()
Dim A As Thread = New Thread(AddressOf TaskA)
Dim B As Thread = New Thread(AddressOf TaskB)
Dim C As Thread = New Thread(AddressOf TaskC)
A.Start()
B.Start()
C.Start()
End Sub
End Module
|