1
How to make a Console program, while it processes some task it execute a writing on the console (like a counter) asynchronous? independent.
In other words, he will be writing independently of other processes. Something like:
ex:
private static async Task EscreveConsole()
{
for (int i = 0; i < 100; i++)
{
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("/"); System.Threading.Thread.Sleep(100);
Console.Clear();
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("-"); System.Threading.Thread.Sleep(100);
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("\\"); System.Threading.Thread.Sleep(100);
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("|"); System.Threading.Thread.Sleep(100);
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("-"); System.Threading.Thread.Sleep(100);
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("|"); System.Threading.Thread.Sleep(100);
Console.CursorTop = 4;
Console.CursorLeft = 90;
Console.Write("/");
System.Threading.Thread.Sleep(100);
}
}
private static void Main(string[] args)
{
EscreveConsole().ConfigureAwait(false);// queria q isso executasse independentemente
TarefaBaseAsync().Wait();
}