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