Skip to content

Instantly share code, notes, and snippets.

@arbales
Created May 28, 2013
Embed
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(&:+)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment