Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2013
What would you like to do?
# Take a MM:SS.MS formatted string and return an integer of MS
def timestring_to_ms(string)
a=[1, 1000, 60000]*2
string.split(/[:\.]/).map{|time| time.to_i*a.pop}.inject(&:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment