How can i measure time between click in the way that if the time between button clicks is lets say >=1000 ms (1 sec) something happends, eg. Msgbox pops out.
private void button1_Click(object sender, EventArgs e)
{
Stopwatch sw = new Stopwatch();
double duration = sw.ElapsedMilliseconds;
double tt = 2000;
sw.Start();
if (duration >= tt)
{
textBox1.Text = "Speed reached!";
}
else
{
sw.Stop();
duration = 0;
}
}