#uptime #pid #ps #application-uptime

process_uptime

Quick and simple way of fetching an application's uptime by pid

5 releases

0.1.4 Dec 20, 2021
0.1.3 Apr 14, 2021
0.1.2 Dec 15, 2020
0.1.1 Dec 15, 2020
0.1.0 Dec 15, 2020

#5 in #ps

29 downloads per month

MIT/Apache

7KB
95 lines

Description

Library fetching process uptime via ps -o etimes -p <PID> --no-headers

If ps is restricted (as is the case on some devices), library fallbacks to fetching process uptime from /proc/{pid}/stat starttime column

Dependencies

~170KB