Skip to content

Instantly share code, notes, and snippets.

@harley
Created July 14, 2012 22:36
Show Gist options
  • Save harley/3113715 to your computer and use it in GitHub Desktop.
Save harley/3113715 to your computer and use it in GitHub Desktop.

Revisions

  1. Harley Trung renamed this gist Jul 14, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Harley Trung revised this gist Jul 14, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Put this at the end of Rakefile
    # Put this in Rakefile (doesn't matter where)
    require 'benchmark'

    class Rake::Task
  3. Harley Trung revised this gist Jul 14, 2012. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,7 @@ class Rake::Task
    bm = Benchmark.measure { execute_without_benchmark(*args) }
    puts " #{name} --> #{bm}"
    end
    alias_method_chain :execute, :benchmark
    end

    alias_method :execute_without_benchmark, :execute
    alias_method :execute, :execute_with_benchmark
    end
  4. Harley Trung created this gist Jul 14, 2012.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Put this at the end of Rakefile
    require 'benchmark'

    class Rake::Task
    def execute_with_benchmark(*args)
    bm = Benchmark.measure { execute_without_benchmark(*args) }
    puts " #{name} --> #{bm}"
    end
    alias_method_chain :execute, :benchmark
    end