View Source FunctionTimer (inr_word v0.1.0)

Provides two functions timed_fun/2 and timed_fun/3 to time any passed function. Function:

Link to this section Summary

Functions

# To pass a captured function

# To pass a Module, Function

Link to this section Functions

# To pass a captured function

iex(1)> FunctionTimer.timed_fun(&InrWord.inr_word/1, 97) |> elem(1) == %{no: "₹ 97", words: "₹ Ninety-seven"}
@spec timed_fun(function(), any(), any()) :: {integer(), any()}
@spec timed_fun(Module, function(), any()) :: {integer(), any()}

# To pass a Module, Function

iex(4)> FunctionTimer.timed_fun(InrWord, :inr_word, [97]) |> elem(1)
%{no: "₹ 97", words: "₹ Ninety-seven"}