Created
March 24, 2021 10:19
-
-
Save romuald/b10635936502a5cd7c14b8032ed03d46 to your computer and use it in GitHub Desktop.
Prefix a command output with elapsed time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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