Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (18 sloc) 0.511 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'benchmark'


Benchmark.bmbm do |x|
  string = File.read(File.expand_path("../../spec/fixtures/responses/whois.nic.tr/status_registered.txt", __FILE__))
  result = "2010-Aug-22."
  x.report("w/i delimiter") do
    100_000.times do
      string =~ /^Expires on\.+:\s+(.+)\n/
      $1 == result || raise
    end
  end
  x.report("w/o delimiter") do
    100_000.times do
      string =~ /Expires on\.+:\s+(.+)\n/
      $1 == result || raise
    end
  end
end
Something went wrong with that request. Please try again.