oxedyne/fe2o3/fe2o3_austenite/tools/bench/corpus/tick.sh
368 bytes, 1 run, executable
created by r1870400018:72525, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | #!/usr/bin/env bash |
| 2 | # tick.sh <wall-file> <command...>: runs the command and writes its wall time in seconds to <wall-file>, read |
| 3 | # from bash's microsecond clock around it, so neither systemd-run nor this shell's own start is counted. |
| 4 | w="$1" |
| 5 | shift |
| 6 | s=$EPOCHREALTIME |
| 7 | "$@" |
| 8 | rc=$? |
| 9 | e=$EPOCHREALTIME |
| 10 | awk -v s="$s" -v e="$e" 'BEGIN { printf "%.4f\n", e - s }' > "$w" |
| 11 | exit $rc |