Skip to content

Instantly share code, notes, and snippets.

View edouard's full-sized avatar

Edouard Brière edouard

View GitHub Profile
@edouard
edouard / stats.rb
Created September 15, 2009 21:11 — forked from mojombo/stats.rb
# Run the given block +num+ times and then print out the mean, median, min,
# max, and stddev of the run. For example:
#
# irb> stats(10) { sleep(rand / 100) }
# mean: 5.99ms
# median: 6.76ms
# min: 1.49ms
# max: 9.28ms
# stddev: 2.54ms
def stats(num)