1Test2::Util::Times(3) User Contributed Perl DocumentationTest2::Util::Times(3)
2
3
4
6 Test2::Util::Times - Format timing/benchmark information.
7
9 This modules exports tools for rendering timing data at the end of
10 tests.
11
13 All exports are optional. You must specify subs to import.
14
15 $str = render_bench($start, $end, $user, $system, $cuser, $csystem)
16 $str = render_bench($start, time(), times())
17 This will produce a string like one of these (Note these numbers
18 are completely made up). Which string is used depends on the time
19 elapsed.
20
21 0.12345s on wallclock (0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.05 CPU)
22
23 11.1234s on wallclock (0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.05 CPU)
24
25 01m:54.45s on wallclock (0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.05 CPU)
26
27 18h:22m:54.45s on wallclock (0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.05 CPU)
28
29 04d:18h:22m:54.45s on wallclock (0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.05 CPU)
30
31 The first 2 arguments are the $start and $end times in seconds (as
32 returned by "time()" or "Time::HiRes::time()").
33
34 The last 4 arguments are timing information as returned by the
35 "times()" function.
36
38 The source code repository for Test2-Suite can be found at
39 https://github.com/Test-More/Test2-Suite/.
40
42 Chad Granum <exodist@cpan.org>
43
45 Chad Granum <exodist@cpan.org>
46
48 Copyright 2018 Chad Granum <exodist@cpan.org>.
49
50 This program is free software; you can redistribute it and/or modify it
51 under the same terms as Perl itself.
52
53 See http://dev.perl.org/licenses/
54
55
56
57perl v5.32.0 2020-12-16 Test2::Util::Times(3)