HerrenRunning

Pace Chart

Running Pace Calculator

Input a distance and time to calculate running times for other distances at that same pace

DISTANCE
UNITS
HOURS
MINUTES
SECONDS


DISTANCE
HOURS
MINUTES
SECONDS
1 Lap
1 Mile
5K
10K
1/2 Marathon
Marathon

Written by Tom Fangrow, USA


function calculate() { var time = 0, hour, min, sec, distance, multiplier, speed, flag = 0; var selectDist = new Array( .000568182, //1 yard .000621371192, //1 meter .2500, //1 lap 1.000, //1 mile .621371192, //1 Km 3.10685596, //5K 6.21371192, //10K 13.109375, //1/2 Marathon 26.21875 //Marathon ); var displayDist = new Array( .2500, //1 lap 1.000, //1 mile 3.10685596, //5K 6.21371192, //10K 13.109375, //1/2 Marathon 26.21875 //Marathon ); for(var j=0; j<5; j++) { if(isNaN(document.inputForm.elements[j].value)) { flag = 1; } } if(flag == 1) alert("Please enter numbers only - no text!"); for(var j=0; j<3; j++) { time += (Math.pow(60, 2-j)) * (document.inputForm.hms[j].value) } distance = selectDist[document.inputForm.distances.value]; multiplier = document.inputForm.mult.value; speed = distance * multiplier / time; //speed in miles/second for(var row=0; row<6; row++) //you know speed in miles/sec { time = displayDist[row]/speed; //find each time in seconds hour = Math.floor(time/3600); //hours is integer division time %= 3600; //seconds left over min = Math.floor(time/60); //minutes is integer division time %= 60; //remaining seconds sec = Math.round(time); //seconds document.outputForm.elements[3 * row + 0].value = hour; document.outputForm.elements[3 * row + 1].value = min; document.outputForm.elements[3 * row + 2].value = sec; } document.outputForm.averageSpeed.value = ("Average speed = " + Math.round(10*speed*3600)/10 + " miles/hour, " + Math.round(speed*1609.344*60) + " meters/minute"); } function erase() { document.inputForm.elements[0].value = "1"; for(var j=2; j<5; j++) { document.inputForm.elements[j].value = ""; } for(var j=0; j<19; j++) { document.outputForm.elements[j].value = ""; } }
Web Hosting Companies