pidof and pgrep are slower than a grep /proc/[1-9]*/comm

Roberto A. Foglietta roberto.foglietta at gmail.com
Sun Sep 10 09:51:36 UTC 2023


On Sun, 10 Sept 2023 at 11:41, Roberto A. Foglietta
<roberto.foglietta at gmail.com> wrote:
>
> On Sat, 9 Sept 2023 at 17:14, Bastian Bittorf <bb at npl.de> wrote:
> >
> > I tried to replicate your findings, but my slow embedded OpenWRT
> > system (with musl libc) is so fast, that your tests always produce
> > 0 seconds execution time.
>
> Shows the test shell code and the results.
>
> redfishos:/rootfs # time date +%s%N
> 1689574011301750356
> real    0m 0.00s
>
> for i in $(seq 1 100); do date +%s%N; done | time cat >/dev/null
> real    0m 0.45s
>
>  As you can see here above, time or date without the nanosecond
> support cannot have the proper time resolution to see the difference
> on a single run. Did you consider this?

https://unix.stackexchange.com/questions/167968/date-in-milliseconds-on-openwrt-on-arduino-yun

This link might help you to understand and address what I am speaking
about (sub-seconds time resolution)

I hope this helps, R-


More information about the busybox mailing list