-
-
Save frizop/c62c84254c8c0ee42c589e546863abac to your computer and use it in GitHub Desktop.
stuff
This file contains 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
[2] pry(main)> require 'benchmark' | |
=> true | |
[3] pry(main)> def check_file(file) | |
[3] pry(main)* filecheck = File.read(file) | |
[3] pry(main)* filecheck.match?(/do do/) | |
[3] pry(main)* end | |
=> :check_file | |
[4] pry(main)> Benchmark.bm(20) do |bm| | |
[4] pry(main)* bm.report("100 lines") { | |
[4] pry(main)* check_file("/home/jidar/Documents/src/ruby/lorem100") | |
[4] pry(main)* } | |
[4] pry(main)* bm.report("1000 lines") { | |
[4] pry(main)* check_file("/home/jidar/Documents/src/ruby/lorem1000") | |
[4] pry(main)* } | |
[4] pry(main)* end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment