xref: /netbsd-src/external/cddl/dtracetoolkit/dist/Docs/Examples/js_calltime_example.txt (revision c29d51755812ace2e87aeefdb06cb2b4dac7087a)
1The following are examples of js_calltime.d.
2
3This script traces the elapsed time of JavaScript functions and
4prints a report. Here it traces the example program,
5Code/JavaScript/func_clock.html
6
7# js_calltime.d
8Tracing... Hit Ctrl-C to end.
9^C
10
11Count,
12   FILE                 TYPE       NAME                                COUNT
13   func_clock.html      func       func_a                                  3
14   func_clock.html      func       func_b                                  3
15   func_clock.html      func       func_c                                  3
16   func_clock.html      func       setTimeout                              3
17   func_clock.html      func       start                                   3
18   func_clock.html      obj-new    Date                                    3
19   func_clock.html      func       getElementById                         12
20   -                    total      -                                      30
21
22Elapsed times (us),
23   FILE                 TYPE       NAME                                TOTAL
24   -                    total      -                                      29
25   func_clock.html      obj-new    Date                                   29
26
27Exclusive function elapsed times (us),
28   FILE                 TYPE       NAME                                TOTAL
29   func_clock.html      func       setTimeout                            229
30   func_clock.html      func       getElementById                        378
31   func_clock.html      func       start                                4061
32   func_clock.html      func       func_a                              51080
33   func_clock.html      func       func_b                             102943
34   func_clock.html      func       func_c                             153330
35   -                    total      -                                  312024
36
37Inclusive function elapsed times (us),
38   FILE                 TYPE       NAME                                TOTAL
39   func_clock.html      func       setTimeout                            229
40   func_clock.html      func       getElementById                        378
41   func_clock.html      func       func_c                             153454
42   func_clock.html      func       func_b                             256470
43   func_clock.html      func       func_a                             307601
44   func_clock.html      func       start                              312054
45
46Counts shows us how many times each different function was called, and how
47many functions were called in total.
48
49The elapsed time shows us the time spent not in a JavaScript function.
50
51The exclusive function elapsed times show the time that each function spent
52processing code - while not in other functions.
53
54The inclusive function elapsed times show the time that each function spent
55processing code, including the time spent in other calls.
56
57These elapsed times are the absolute time from when the function began to
58when it completed - which includes off-CPU time due to other system events
59such as I/O, scheduling, interrupts, etc.
60
61