use File::Temp qw/tempdir/;
use JSON qw/decode_json encode_json/;
use Sys::Hostname qw/hostname/;
-use Time::HiRes qw/time/;
use Try::Tiny;
use Log::Log4perl qw/get_logger/;
$judge = safe_can Judge => judge => $judge;
for my $test (1 .. $testcnt) {
- my $start_time = time;
my $result;
unlink 'result';
try {
}
};
+ my $time = '?';
+ $time = (read_file 'time-stop-prog') - (read_file 'time-start-prog') if -f 'time-stop-prog' && -f 'time-start-prog';
+ unlink 'time-start-prog', 'time-stop-prog';
if (ref $result) {
my $result_text = $result->[1];
$result_text .= ': ' . read_file 'result' if -s 'result';
get_logger->trace("Test $test result is " . $result_text);
- push @full_results, {id => $test, result => $result->[0], result_text => $result_text, time => time - $start_time}
+ push @full_results, {id => $test, result => $result->[0], result_text => $result_text, time => $time}
} else {
get_logger->trace("Test $test result is $result");
- push @full_results, {id => $test, result => 0, result_text => $result, time => time - $start_time}
+ push @full_results, {id => $test, result => 0, result_text => $result, time => $time}
}
push @results, $result;
last if $meta->{judge} eq 'Absolute' && ref $result
use List::MoreUtils qw/natatime/;
use Log::Log4perl qw/get_logger/;
use String::ShellQuote qw/shell_quote/;
+use Time::HiRes qw/time/;
use Try::Tiny;
our $VERSION = '5999.000_005';
kill KILL => $pid{$vm} if $kill;
waitpid $pid{$vm}, 0;
}
+ write_file "time-stop-$vm", time;
return if $kill;
my $er = "exec-result-$vm";
sub execlist {
my ($vm, @args) = @_;
+ write_file "time-start-$vm", time;
my $er = "exec-result-$vm";
if ($vm{$vm}) {
my $cmd = ">$er " . shell_quote 'gruntmaster-exec', @args;