Created
February 10, 2019 18:01
-
-
Save PragTob/ac87f3ef02b144aa7240452566dbed09 to your computer and use it in GitHub Desktop.
erlang timer.tc implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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