Skip to content

Instantly share code, notes, and snippets.

@sntran
Created September 7, 2013 19:32
Show Gist options
  • Save sntran/6478527 to your computer and use it in GitHub Desktop.
Save sntran/6478527 to your computer and use it in GitHub Desktop.
-module(helpers).
is_pid_alive(Pid) when node(Pid) =:= node() ->
is_process_alive(Pid);
is_pid_alive(Pid) ->
lists:member(node(Pid), nodes()) andalso
(rpc:call(node(Pid), erlang, is_process_alive, [Pid]) =:= true).
get_current_time() ->
Now = calendar:local_time(),
calendar:datetime_to_gregorian_seconds(Now).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment