… | |
… | |
60 | select $fh; |
60 | select $fh; |
61 | |
61 | |
62 | # compile first, then execute, as Coro does not support switching in eval string |
62 | # compile first, then execute, as Coro does not support switching in eval string |
63 | my $cb = eval "sub { $cmd \n}"; |
63 | my $cb = eval "sub { $cmd \n}"; |
64 | |
64 | |
65 | my $t1 = Time::HiRes::time; |
65 | my $t1 = EV::time; |
66 | my @res = $@ ? () : eval { $cb->() }; |
66 | my @res = $@ ? () : eval { $cb->() }; |
67 | my $t2 = Time::HiRes::time; |
67 | my $t2 = EV::time; |
68 | |
68 | |
69 | print "\n", |
69 | print "\n", |
70 | "command: '$cmd'\n", |
70 | "command: '$cmd'\n", |
71 | "execution time: ", $t2 - $t1, "\n"; |
71 | "execution time: ", $t2 - $t1, "\n"; |
72 | print "evaluation error: $@\n" if $@; |
72 | print "evaluation error: $@\n" if $@; |