When doing ps -r -e -o pcpu=,comm=, the % CPU displayed per process, over how long time is this value measured? Is it one second? The manual page does not seem to mention this.
And a follow-up question: Is it possible to have ps (or another standard UNIX utility) report the CPU percentage per process over a longer period of time, like 5 seconds? (Obviously, one could just gather up 5 values and calculate the average, but I'm not sure if that would even be correct
...)
PS! If it matters, I'm on macOS (which runs a BSD variant).
psmeasures anything, it just reports the information that the kernel gives it.psis not actually a standard Unix utility, so you probably want to say what Unix system you are running on if you want to know about howpsqueries for the information that it shows.