Permalink
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 610 Bytes
' Visual Basic .NET Document
Option Strict On
' <Snippet2>
Imports System.Threading
Imports System.Threading.Tasks
Module Example
Public Sub Main()
Thread.CurrentThread.Name = "Main"
Dim taskA As Task = Task.Run(Sub() Console.WriteLine("Hello from taskA."))
' Output a message from the calling thread.
Console.WriteLine("Hello from thread '{0}'.",
Thread.CurrentThread.Name)
taskA.Wait()
End Sub
End Module
' The example displays output like the following:
' Hello from thread 'Main'.
' Hello from taskA.
' </Snippet2>