Skip to content

Instantly share code, notes, and snippets.

@arbales
Created May 28, 2013 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbales/5660690 to your computer and use it in GitHub Desktop.
Save arbales/5660690 to your computer and use it in GitHub Desktop.
# 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