Skip to content

Instantly share code, notes, and snippets.

@cassioscabral
Created February 5, 2015 17:03
Show Gist options
  • Save cassioscabral/fe40942b328d12701592 to your computer and use it in GitHub Desktop.
Save cassioscabral/fe40942b328d12701592 to your computer and use it in GitHub Desktop.
Capybara measure time stress test
it "should access the page 20 times" do
beginning_time_all = Time.now
(1..20).each do |i|
beginning_time = Time.now
visit "/my/page"
end_time = Time.now
puts "Time elapsed #{(end_time - beginning_time)*1000} milliseconds"
end
end_time_all = Time.now
puts "ALL -> Time elapsed #{(end_time_all - beginning_time_all)*1000} milliseconds"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment