Skip to content

Instantly share code, notes, and snippets.

@elbrujohalcon
Created June 22, 2021 08:31
Show Gist options
  • Save elbrujohalcon/4e25539031ec179495313a30b6f3dea3 to your computer and use it in GitHub Desktop.
Save elbrujohalcon/4e25539031ec179495313a30b6f3dea3 to your computer and use it in GitHub Desktop.
Process Info Checker - v1
-module(pi).
-export([check/0]).
check() ->
Pid = spawn(fun wait/0),
erlang:yield(),
PI1 = erlang:process_info(Pid),
PI2 = erlang:process_info(Pid),
Pid ! stop,
#{diff => PI2 -- PI1, pi1 => PI1, pi2 => PI2}.
wait() ->
receive
stop ->
ok
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment