thread sleep without blocking ui c# code example
Example 1: c# thread sleep
Thread.Sleep(2000); //in ms
Example 2: Wait some seconds without blocking UI execution
async Task PutTaskDelay()
{
await Task.Delay(5000);
}
private async void btnTaskDelay_Click(object sender, EventArgs e)
{
await PutTaskDelay();
MessageBox.Show("I am back");
}