Skip to content

Instantly share code, notes, and snippets.

@PragTob
Created February 10, 2019 18:01
Show Gist options
  • Save PragTob/ac87f3ef02b144aa7240452566dbed09 to your computer and use it in GitHub Desktop.
Save PragTob/ac87f3ef02b144aa7240452566dbed09 to your computer and use it in GitHub Desktop.
erlang timer.tc implementation
tc(F) ->
T1 = erlang:monotonic_time(),
Val = F(),
T2 = erlang:monotonic_time(),
Time = erlang:convert_time_unit(T2 - T1, native, microsecond),
{Time, Val}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment