Rake::Benchmark
Intercepts all calls to Rake::Task.execute
and wraps them with Benchmark
, outputting the timing informtion after the rake task completes.
Installation
Add it to your Gemfile:
gem 'rake-benchmark', require: false
And install it:
$ bundle
Then, require it in your Rakefile
like this:
require 'rake/benchmark'
Example Rakefile
#!/usr/bin/env rake
require 'rake/benchmark'
desc "A sleepy rake task"
task :sleepy do
puts "zzZZZzz"
sleep(3)
end
Outputs:
$ rake sleepy
zzZZZzz
sleepy --> 0.000000 0.000000 0.000000 ( 3.001075)
Project Status
Special Thanks
Inspired by a blog post by Gabe de Silveira.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request