Add a routine and use after each 'time' calculation. Use her variables to calculate. To calculate the MPH you are going to have to either hard code in the distance or use inputs, ie switch panel and display, to adjust measured distance.

Elapsed Time (seconds)
Distance(feet)

MPH = (Distance/5280 (calculates percentage of one mile)) / (Elapsed Time / 60 (to get to minutes) / 60 ( to get to one hour))

Example

Elapsed time = 30 seconds
Distance = 2 miles

MPH = (10560/5280)/(30/60/60)
MPH = 2/0.0083
MPH = 240