Skip to content

Instantly share code, notes, and snippets.

@pauloalem
Last active December 16, 2015 09:19
Show Gist options
  • Save pauloalem/5412570 to your computer and use it in GitHub Desktop.
Save pauloalem/5412570 to your computer and use it in GitHub Desktop.
calculo e formatando "pace" em min/km
def ritmo(segs, ms):
kms = ms / 1000
mins = segs / 60
horas = mins / 60
ritmo_seg = segs / kms / 60
pace_min = ritmo_seg - ritmo_seg % 1
pace_seg = ritmo_seg % 1 * 0.6 * 100
pace_seg = pace_seg - pace_seg % 1;
return str(pace_min) + ":" + str(pace_seg) + "min/km";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment