/
githubmirror
/
jekyll
Обзор
Документация
Войти
/
githubmirror
/
jekyll
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
benchmark/proc-call-vs-yield
15 строк
222 B
fen
include a hashbang for all benchmark scripts
22 окт 2016, 04:13
22 окт 2016, 04:13
7729d12
Код
Авторство
О чём код?
#!/usr/bin/env ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('yield') { fast { (0..9).to_a } } x.report('block.call') { slow { (0..9).to_a } } end