Created
May 23, 2018 06:08
-
-
Save germ13/28b1fe08654afab0e8d83e74c2f55802 to your computer and use it in GitHub Desktop.
16 Tasks
This file contains hidden or 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
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