Skip to content

Instantly share code, notes, and snippets.

@myobie
Created May 6, 2009 20:41
Show Gist options
  • Save myobie/107728 to your computer and use it in GitHub Desktop.
Save myobie/107728 to your computer and use it in GitHub Desktop.
start_t = Time.now.to_f
test.line_count # => 31
Time.now.to_f - start_t # => 0.0107550621032715
start_t = Time.now.to_f
test.inject(0) { |sum, line| sum+1 } # => 31
Time.now.to_f - start_t # => 0.000140905380249023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment