![]() |
|< 1 2 >| | ![]() |
17 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
my $timeout = 10; # seconds
eval {
local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
alarm $timeout;
C_function_call();
alarm 0;
};
if ($@) {
die unless $@ eq "alarm\n"; # propagate unexpected errors
# timed out
}
else {
# didn't
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
test_info(" Run to Breakpoint ");
$SIG{ALARM}=sub {};
$usec1 = gettimeofday;
eval{
alarm(20);
prozess_Run ( 'RUN_TO_BREAKPOINT', 'FALSE')||($DevCon[13] =1);
##############################################################################
$counter = 0;
#State call to end the run
test_info("Breakpoint State");
do
{
prozess_State ( \$state, 'FALSE', \$cycle,\$loopbreak)||($DevCon[14] =1);
$counter++;
}
while ($loopbreak != 3);
my $usec2 = gettimeofday;
my $usec = $usec2-$usec1;
printf "State of the run: $state\n";
printf "Cycles if single step is used: $cycle\n";
printf "Cycles until breakpoint was hit: $counter\n";
printf "Loop Runtime : %.4f sec\n",$usec;
alarm(0);
};
1
2
3
4
5
6
7
if ($@) {
die unless $@ eq "alarm\n"; # propagate unexpected errors
# timed out
}
else {
# didn't
}
![]() |
|< 1 2 >| | ![]() |
17 Einträge, 2 Seiten |