ps icon indicating copy to clipboard operation
ps copied to clipboard

`ps_create_time()` and `ps_boot_time()` drifts on Linux

Open dansmith01 opened this issue 8 months ago • 3 comments

I noticed that ps_create_time() will return a different process creation time, depending on the creation time of the process that queries it.

First Process:

docker run -it --rm --name test rocker/r-ver:4.5.0
install.packages('ps')
Sys.getpid()
#> [1] 1
ps::ps_create_time(ps::ps_handle(1))
#> [1] "2025-05-07 17:50:18 GMT"

(wait a few minutes before launching second process)

Second Process:

docker exec -it test R
ps::ps_create_time(ps::ps_handle(1))
#> [1] "2025-05-07 17:50:35 GMT"

(wait a few more minutes)

Third Process:

docker exec -it test R
ps::ps_create_time(ps::ps_handle(1))
#> [1] "2025-05-07 17:51:00 GMT"

dansmith01 avatar May 07 '25 18:05 dansmith01