Skip to content

Instantly share code, notes, and snippets.

@germ13
Created May 23, 2018 06:08
Show Gist options
  • Save germ13/28b1fe08654afab0e8d83e74c2f55802 to your computer and use it in GitHub Desktop.
Save germ13/28b1fe08654afab0e8d83e74c2f55802 to your computer and use it in GitHub Desktop.
16 Tasks
public static void Main(string[] args)
{
var t = new Task[16];
for (var i = 0; i < 16; i++)
{
Count((ConsoleColor)i);
}
Console.ReadKey();
}
public static Task Count(ConsoleColor color)
{
return Task.Run(() =>
{
for (int i = 0; i < 200; i++)
{
Console.ForegroundColor = color;
Console.WriteLine(i);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment