line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Sys::SigAction::Alarm; |
3
|
|
|
|
|
|
|
require 5.005; |
4
|
6
|
|
|
6
|
|
20365
|
use strict; |
|
6
|
|
|
|
|
5
|
|
|
6
|
|
|
|
|
188
|
|
5
|
|
|
|
|
|
|
#use warnings; |
6
|
6
|
|
|
6
|
|
20
|
use vars qw( @ISA @EXPORT_OK ); |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
387
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
@ISA = qw( Exporter ); |
9
|
|
|
|
|
|
|
@EXPORT_OK = qw( ssa_alarm ); |
10
|
6
|
|
|
6
|
|
2590
|
my $have_hires = scalar eval 'use Time::HiRes; Time::HiRes::ualarm(0); 1;'; |
|
6
|
|
|
|
|
5790
|
|
|
6
|
|
|
|
|
45
|
|
11
|
6
|
|
|
6
|
|
399
|
use POSIX qw( INT_MAX ceil ) ; |
|
6
|
|
|
|
|
4918
|
|
|
6
|
|
|
|
|
22
|
|
12
|
|
|
|
|
|
|
my $hrworks; |
13
|
|
|
|
|
|
|
sub ssa_alarm($) |
14
|
|
|
|
|
|
|
{ |
15
|
14
|
|
|
14
|
0
|
13
|
my $secs = shift; |
16
|
|
|
|
|
|
|
#print print "secs=$secs\n"; |
17
|
|
|
|
|
|
|
|
18
|
14
|
100
|
66
|
|
|
205
|
if ( $hrworks and ($secs le (INT_MAX()/1_000_000.0) ) ) |
19
|
|
|
|
|
|
|
{ |
20
|
13
|
|
|
|
|
80
|
Time::HiRes::ualarm( $secs * 1_000_000 ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
else |
23
|
|
|
|
|
|
|
{ |
24
|
1
|
|
|
|
|
31
|
alarm( ceil( $secs ) ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
2
|
0
|
1408
|
sub hires_works { return $hrworks; }; #test support |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$hrworks = 1; 1; |