Little code snippet about timer. Hope that help.
Timer timer;
int secondsToPlay;
private void StartPlay_Click(object sender, EventArgs e)
{
timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 1000;
DateTime Start = dateTimePicker1.Value;
DateTime End = dateTimePicker2.Value;
TimeSpan total = End - Start;
secondsToPlay = (int)total.TotalSeconds;
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
secondsToPlay--;
if (secondsToPlay <= 0)
{
timer.Stop();
}
}