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

  • Build: Build Status
  • Code Quality: Code Climate
  • Dependencies: Dependency Status

Special Thanks

Inspired by a blog post by Gabe de Silveira.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request