Benchee v0.3.0 Benchee.RepeatN

Simple helper module that can easily make a function call repeat n times. Which is significantly faster than Enum.each/list comprehension.

Check out the benchmark in samples/repeat_n.exs:

Name                          ips            average        deviation      median
Recursion                     76037.28       13.15μs        (±10.76%)      13.0μs
Enum.each                     54930.00       18.20μs        (±22.01%)      18.0μs
List comprehension            46742.24       21.39μs        (±20.72%)      21.0μs

Comparison:
Recursion                     76037.28
Enum.each                     54930.00        - 1.38x slower
List comprehension            46742.24        - 1.63x slower

Summary

Functions

Calls the given function n times

Functions

repeat_n(function, count)

Calls the given function n times.