Skip to content

Instantly share code, notes, and snippets.

@patrickgombert
Created February 1, 2013 21:02
Show Gist options
  • Save patrickgombert/4694122 to your computer and use it in GitHub Desktop.
Save patrickgombert/4694122 to your computer and use it in GitHub Desktop.
Spec helper timer saver
require 'timer'
unless defined?(REQUIRED_SPEC_HELPER)
REQUIRED_SPEC_HELPER = true
File.open("spec_helper_times.yml", 'a+') do |file|
date_time = DateTime.now.strftime("%m%d%y%H%M")
time = Time.now
Kernel.load("spec_helper.rb", true)
final_time = Time.now - time
file << "#{date_time}: #{final_time}\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment