Created
November 6, 2023 09:10
-
-
Save rahulsahay19/bd16a567fb1edeab4fe2539ee5a45873 to your computer and use it in GitHub Desktop.
hello tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
public class TPLBeginnerExample | |
{ | |
public static void Main(string[] args) | |
{ | |
// Create and run a task | |
Task task = Task.Run(() => | |
{ | |
Console.WriteLine("Hello, TPL!"); | |
}); | |
// Wait for the task to complete | |
task.Wait(); | |
Console.WriteLine("Task has completed."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment