posix: multi process: add support for times()
Add support for the `times()` function, which can be used to get the
number of ticks spent in "system" and "user" mode, and which returns
the "real time" that has expired, since an arbitrary point in the past.
The following invariant should always hold:
rtime <= stime + utime
The `times()` function measures time for the calling process and all
of it's child processes. In Zephyr, we don't support separate processes
(yet), so the time spent in child processes is zero.
Additionally, in Zephyr we do not differentiate between "system" time
(i.e. time spent executing kernel code) and "user" time (time spent
executing application code). We only have information on "total time"
(time spent executing code) and "execution time" (time spent executing
code plus idle time).
For now, only report utime, since it is not clear how to obtain other
values.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
4 files changed