Pace in miles → km

I’m always really annoyed by all the americans when they write run speeds in pace per mile. Why, oh why, do they keep using a completely braindead system of measurement where you have 12 inches per foot and a furlong is one eighth of a mile? It makes no sense whatsoever.

The SI system for the win!

I’ve written a trivial little commandline utility in ruby to convert to a sane system. Here’s the code:

#!/usr/bin/env ruby -w

# Author:  Morten Liebach <>
# License: public domain.

min, sec = ARGV[0].split(':')
t = ((min.to_i * 60 + sec.to_f) / 1.60934).round
printf "Pace:  %d:%02d/km\nSpeed: %.2f km/h, %.2f m/s\nTrack: %.1f sec/400m\n",
    t.to_i / 60, (t - ((t.to_i / 60) * 60)).round,
    ((1000.0 / t) * 3.6), 1000.0 / t, t / 2.5

Use like this:

$ m2kp 7:51
Pace:  4:53/km
Speed: 12.29 km/h, 3.41 m/s
Track: 117.2 sec/400m

Perhaps I should make a version that could convert the other way, but that would be like perpetuating something which should not exist anymore, so I won’t. I’ll leave that as an exercise for the reader, post the answer in the comments if you want.