1
0
Fork 0
mirror of synced 2025-09-23 04:08:33 +00:00

update benchmark script

This commit is contained in:
dark64 2021-02-23 14:38:12 +01:00
parent 7d91ea483c
commit d50a2c6b10

View file

@ -1,7 +1,13 @@
#!/bin/bash
cmd=$*
format="mem=%K rss=%M elapsed=%E cpu=%P cpu.sys=%S inputs=%I outputs=%O"
# Usage: benchmark.sh <command>
# For MacOS: install gtime with homebrew `brew install gnu-time`
echo 'Benchmarking ' $cmd;
/usr/bin/time -f "$format" bash -c "$cmd"
cmd=$*
format="mem=%KK rss=%MK elapsed=%E cpu=%P cpu.sys=%S inputs=%I outputs=%O"
if command -v gtime; then
gtime -f "$format" $cmd
else
/usr/bin/time -f "$format" $cmd
fi