Skip to content

Instantly share code, notes, and snippets.

@paaloeye
Created May 15, 2012 18:11
Show Gist options
  • Save paaloeye/2703853 to your computer and use it in GitHub Desktop.
Save paaloeye/2703853 to your computer and use it in GitHub Desktop.
Time diff with nanosec
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