I am using a waiting task delay. I want to understand the problem by giving an example:
private async void timer2_Tick(object sender, EventArgs e)
{
await Task.Delay(5000);
label1.Text = "1";
await Task.Delay(5000);
label1.Text = "2";
await Task.Delay(5000);
}
Timer internal: 1000 Problem : Always writes 1 and 2 to the label.Can not wait
When I write the above code to the timer, it always starts and nonsense. I want to sleep without freezing the form. how can I do that?