This function works even if the process has already finished.

ps_pid(p = ps_handle())

Arguments

p

Process handle.

Value

Process id.

Examples

p <- ps_handle()
p
#> <ps::ps_handle> PID=4139632, NAME=R, AT=2025-10-29 18:06:27.39
ps_pid(p)
#> [1] 4139632
ps_pid(p) == Sys.getpid()
#> [1] TRUE