Oregami
Repositories/oxedyne/fe2o3

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.
4w="$1"
5shift
6s=$EPOCHREALTIME
7"$@"
8rc=$?
9e=$EPOCHREALTIME
10awk -v s="$s" -v e="$e" 'BEGIN { printf "%.4f\n", e - s }' > "$w"
11exit $rc