ThisCalculator

Everyday

React Callback Prop: Parent Function from Child

Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered

Yes, you use a callback prop to run a parent function from a React child component. The parent defines the function, passes it as a prop to the child, and the child calls that prop (usually inside an event handler or a useEffect) to trigger the parent’s logic. This is the standard, one-way data flow in React: data goes down via props, and events go up via callbacks.

Formula

This calculator computes running pace and speed from a finish time and distance. The formulas are:

  • Pace (min/km) = Finish time (min) ÷ Distance (km)
  • Speed (km/h) = Distance (km) ÷ (Finish time (min) ÷ 60)

Where:

  • t = finish time in minutes (e.g., 50)
  • d = distance in kilometers (e.g., 10)

Pace tells you how many minutes each kilometer takes; speed tells you how many kilometers you cover in one hour. Both are common ways to express running intensity.

Worked Example

Using the default values: finish time = 50 minutes, distance = 10 km.

  1. Pace = 50 ÷ 10 = 5.00 min/km
  2. Speed = 10 ÷ (50 ÷ 60) = 10 ÷ 0.8333 = 12.00 km/h

The calculator shows an average pace of 5:00 min/km and a speed of 12.00 km/h. That matches the default output.

When to Use This Calculator

Use it after a run or race when you know the total time and the distance. It works for any distance – a 5K, 10K, half marathon, or a training run on a track. You can also use it in reverse: if you have a target pace, you can plan what time to aim for, though you would need to rearrange the formula (time = pace × distance).

The result is an average. Real runs have hills, stops, and uneven effort, so your instantaneous pace will vary. This gives a single number that summarizes the whole effort.

How to Read the Result

A lower pace (e.g., 4:30 min/km) means faster running; a higher pace (e.g., 6:15 min/km) means slower. Speed works the opposite way – higher speed is faster. Runners often use pace because it is easier to relate to each kilometer on the course. Coaches and fitness apps may show speed for cycling or treadmill settings.

If you run 10 km in 50 minutes, you are moving at 12 km/h. If you double the distance to 20 km in the same time, your pace becomes 2:30 min/km – that would be an extremely fast world‑record level, so the calculator is just doing the math, not judging feasibility.

Common Mistakes and Unit Mix-Ups

  • Mixing minutes and seconds: If your time is 1:23:45 (1 hour, 23 min, 45 sec), convert to minutes first: 60 + 23 + 45/60 = 83.75 minutes.
  • Using miles with km: The calculator assumes kilometers. If your distance is in miles, convert to km (1 mile = 1.60934 km) before entering.
  • Confusing pace and speed: Pace is time per distance; speed is distance per time. They are reciprocals (with unit conversion). A pace of 5 min/km equals 12 km/h, not 5 km/h.
  • Rounding too early: Keep at least two decimal places in intermediate steps to avoid errors in the final speed.

Limits of the Formula

This is a pure arithmetic average. It does not account for:

  • Elevation gain or loss
  • Wind, temperature, or terrain
  • Stops for water or traffic lights
  • Variation in effort (splits)

For training purposes, you might want to see your split paces per kilometer – that requires separate calculations for each segment. The formula is still the same, just applied to smaller chunks.

Frequently Asked Questions

What is a good pace for a beginner?

There is no single answer – it depends on age, fitness, and experience. A common starting point for a recreational runner is around 6:00–7:00 min/km (about 8.5–10 km/h). The best pace is one you can sustain comfortably for the distance.

How do I convert pace to speed?

Divide 60 by the pace in minutes per km. For example, 5 min/km → 60 ÷ 5 = 12 km/h. To convert speed to pace, divide 60 by the speed in km/h.

Can I use this for walking?

Yes. Walking pace is usually slower, like 10–12 min/km (5–6 km/h). The formula works the same for any human-powered movement.

Why does the calculator show pace in min/km and not min/mile?

Because the default distance unit is kilometers. If you want min/mile, you can enter the distance in miles, but the pace will still be labeled min/km – you would need to manually convert (1 mile = 1.609 km). For a true min/mile result, use a calculator that supports miles.

Is a faster speed always better?

Not necessarily. For long distances, a sustainable pace is more important than raw speed. Elite marathoners run at about 20 km/h, but a beginner might only sustain 8 km/h. Faster is relative to the distance and your training.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.