Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created January 3, 2014 23:48
Show Gist options
  • Select an option

  • Save practicingruby/8249046 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/8249046 to your computer and use it in GitHub Desktop.
my_time_func(F) ->
{MegaS@T1, S@T1, MicroS@T1 } = erlang:now(),
F(),
{MegaS@T2, S@T2, MicroS@T2 } = erlang:now(),
(MegaS@T2 - MegaS@T1)*1000000 + (S@T2 - S@T1) + (MicroS@T2 - MicroS@T1)/1000000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment