I am starting a timer and I want the method to wait until some time passed. I have searched in other similar questions but cannot find a clear answer. Why is does the following code freeze the app? elapsed time starts at 0 and intervall is 1000 (1sec)
private void timer2_Tick(object sender, EventArgs e)
{
elapsedtime2++;
}
//this is inside my method
timer2.Start();
while (elapsedtime2 < 3)
{
}
timer2.Stop();