Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Created November 6, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulsahay19/bd16a567fb1edeab4fe2539ee5a45873 to your computer and use it in GitHub Desktop.
Save rahulsahay19/bd16a567fb1edeab4fe2539ee5a45873 to your computer and use it in GitHub Desktop.
hello tpl
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