8 die "Usage: $0 <prefix> <command...>\n";
16 ($sec, $usec) = Time::HiRes::gettimeofday();
19 unless (defined($sec) && defined($usec)) {
20 my $tv_t = ($Config{'longsize'} == 8) ? 'qq' : 'll';
21 my $tv = pack $tv_t, 0, 0;
25 syscall(SYS_gettimeofday(), $tv, 0);
28 ($sec, $usec) = unpack $tv_t, $tv;
34 my ($prefix, @cmd) = @ARGV;
35 my ($sec, $usec) = gettime();
39 die "$0: Failure to fork(): $!\n";
43 die "$0: Failure to exec(): $!\n";
46 $SIG{'INT'} = 'IGNORE';
47 $SIG{'QUIT'} = 'IGNORE';
49 if (waitpid($pid, 0) == -1) {
50 die "$0: Failure to waitpid(): $!\n";
53 my $exitcode = $? >> 8;
54 my ($sec2, $usec2) = gettime();
55 my (undef, undef, $cuser, $csystem) = times();
57 printf STDERR "%s#%.2f#%.2f#%.2f\n",
58 $prefix, $cuser, $csystem,
59 ($sec2 - $sec) + ($usec2 - $usec) / 1000000;
61 $SIG{'INT'} = 'DEFAULT';
62 $SIG{'QUIT'} = 'DEFAULT';