File: test70-subexcl.p

package info (click to toggle)
libdevel-nytprof-perl 6.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,552 kB
  • sloc: perl: 5,616; javascript: 4,033; ansic: 107; makefile: 23
file content (28 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (5)
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
# This test isn't very useful until we can test subroutine timings
# perhaps by adding an option to nytprofcsv to include them
# and adjusting test.pl to test for them (including the ~N fudge factor).
# Meanwhile the test is useful for sanity checking the subroutine timing
# code using a command like
# make && NYTPROF_TEST=trace=3 perl -Mblib test.pl -leave=1 -use_db_sub=0 t/test70-subexcl.*

my $T = $ENV{NYTPROF_TEST_PAUSE_TIME} || 0.2;

sub A {     # inclusive ~= $T, exclusive ~= $T
    select undef, undef, undef, $T;
}

sub B {     # inclusive ~= $T*2, exclusive ~= $T
    A();
    select undef, undef, undef, $T;
}

sub C {     # inclusive ~= $T*2, exclusive ~= 0.0
    B();
}

sub D {     # inclusive ~= $T*4, exclusive ~= 0.0
    C();
    C();    # cumulative_subr_secs non-zero on sub entry
}

D();