static void Client()
{
while (true)
{
Console.WriteLine("TEST");
Thread.Sleep(900);
}
}
// See https://aka.ms/new-console-template for more information
await DoWork();
async Task DoWork()
{
int counter = 0;
while (true)
{
Console.WriteLine($"TEST {++counter}");
await Task.Delay(900);
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>