Current section
Files
Jump to
Current section
Files
src/pocket_watch_ffi.erl
-module(pocket_watch_ffi).
-export([elapsed/1]).
elapsed(Fun) ->
Start = erlang:monotonic_time(),
Return = Fun(),
Stop = erlang:monotonic_time(),
Elapsed = float(erlang:convert_time_unit(Stop - Start, native, nanosecond)),
{Return, Elapsed}.