pidof and pgrep are slower than a grep /proc/[1-9]*/comm
Roberto A. Foglietta
roberto.foglietta at gmail.com
Sun Sep 10 09:41:01 UTC 2023
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?
Best regards, R-
More information about the busybox
mailing list