This function works even if the process has already finished.

ps_pid(p)

Arguments

p

Process handle.

Value

Process id.

See also

Examples

p <- ps_handle() p
#> <ps::ps_handle> PID=17400, NAME=R, AT=2020-02-16 11:38:31
ps_pid(p)
#> [1] 17400
ps_pid(p) == Sys.getpid()
#> [1] TRUE