Created
May 28, 2013 05:40
-
-
Save arbales/5660690 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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