Skip to content

Instantly share code, notes, and snippets.

@romuald
Created March 24, 2021 10:19
Show Gist options
  • Save romuald/b10635936502a5cd7c14b8032ed03d46 to your computer and use it in GitHub Desktop.
Save romuald/b10635936502a5cd7c14b8032ed03d46 to your computer and use it in GitHub Desktop.
Prefix a command output with elapsed time
#!/bin/env perl
# Usage: anycommand | timing.pl
use strict;
use warnings;
use Time::HiRes qw/time/;
my $start = time();
while (<>) {
printf "%.3f ", time() - $start;
print;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment