Portable rusage command

submited by
Style Pass
2023-03-16 08:30:04

I wrote a program called rusage.com which provides the best possible way to report resource usage statistics when launching command line programs. It provides a much richer set of information than the traditional UNIX time command: $ time /bin/echo hi >/dev/null real 0m0.001s user 0m0.001s sys 0m0.000s

Above we see time isn't very good, since it only reports CPU usage at millisecond granularity. On the other hand, rusage.com gives you the full power of the underlying system calls (wait4(2) and getrusage(2)) which provide a richer set of higher precision information. $ rusage.com /bin/echo hi hi RL: took 551µs wall time RL: ballooned to 1,472kb in size RL: needed 478µs cpu (0% kernel) RL: caused 89 page faults (100% memcpy) Download  

rusage.com is distributed as a single-file dependency-free executable that you can use on any AMD64 operating system, as well as ARM64 platforms like Apple M1 and Raspberry Pi.

Leave a Comment