Skip to content

Instantly share code, notes, and snippets.

@niftynei
Created June 30, 2016 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niftynei/b1e6504c4913261d0b62c8937a4ff115 to your computer and use it in GitHub Desktop.
Save niftynei/b1e6504c4913261d0b62c8937a4ff115 to your computer and use it in GitHub Desktop.
Handy Erlang One Liners
% Figure out how many messages there are in your mailbox
process_info(self(), message_queue_len).
% Register wall_clock & runtime
statistics(wall_clock), statistics(runtime).
% A function to check the next message in the mailbox
F = fun() -> receive X -> X after 0 -> no_message end end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment