Skip to content

Instantly share code, notes, and snippets.

View vikrum-seq's full-sized avatar
🎯
Focusing

vikrum vikrum-seq

🎯
Focusing
View GitHub Profile
function timestamp_output() {
{ "$@"; } 2>&1 | perl -MTime::HiRes=time -MPOSIX=strftime -ne '
BEGIN { $prev = time(); }
$now = time();
$delta = sprintf("%.3f", $now - $prev);
$prev = $now;
printf "%ss %s %s", $delta, strftime("%Y-%m-%d %H:%M:%S", localtime($now)), $_;
'
}