Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/benchmark/bm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ module Benchmark
end

# Reports a single benchmark unit.
def report(label = " ", &block)
def report(label : String = " ", &block : ->) : Nil
@label_width = label.size if label.size > @label_width
@reports << {label, block}
end

# :nodoc:
def execute
def execute : Nil
if @label_width > 0
print " " * @label_width
end
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/ips.cr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Benchmark
end

# Adds code to be benchmarked
def report(label = "", &action) : Benchmark::IPS::Entry
def report(label : String = "", &action : ->) : Benchmark::IPS::Entry
item = Entry.new(label, action)
@items << item
item
Expand Down