Skip to content

Instantly share code, notes, and snippets.

@dfockler
Created April 8, 2015 19:35
Show Gist options
  • Save dfockler/f03e0e2ab34438410853 to your computer and use it in GitHub Desktop.
Save dfockler/f03e0e2ab34438410853 to your computer and use it in GitHub Desktop.
require 'benchmark'
all_posts = [1,2,3]
def self.scale(all_posts)
all_posts.cycle(100) do |x|
return x % 2 == 0
end
all_posts << all_posts[-1] + 1
end
puts Benchmark.measure {scale(all_posts)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment