Created
May 15, 2012 18:11
-
-
Save paaloeye/2703853 to your computer and use it in GitHub Desktop.
Time diff with nanosec
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
def diff t2, t1 | |
nsec = t2.nsec - t1.nsec | |
sec = (t2 - t2.nsec) - (t1 - t1.nsec) | |
sec + nsec | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment