private static double SecondsBetween(DateTime FirstTime, DateTime SecondTime) { //Calculate the number of seconds and fractions of a second that have elapsed between the first time and the second var difference = SecondTime.Subtract(FirstTime); return difference.TotalMilliseconds/1000; }