#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes qw /gettimeofday/;
die "wrong param count\n" if scalar @ARGV == 0;
my $time_start = gettimeofday;
my $prog_name = shift;
open my $F, '-|', $prog_name, @ARGV or die "open() error: $!\n";
print while <$F>;
close $F;
my $time = sprintf '%.2f', gettimeofday - $time_start;
print "\nExecution time: ", $time, " sec.\n";