The following are examples of js_calltime.d. This script traces the elapsed time of JavaScript functions and prints a report. Here it traces the example program, Code/JavaScript/func_clock.html # js_calltime.d Tracing... Hit Ctrl-C to end. ^C Count, FILE TYPE NAME COUNT func_clock.html func func_a 3 func_clock.html func func_b 3 func_clock.html func func_c 3 func_clock.html func setTimeout 3 func_clock.html func start 3 func_clock.html obj-new Date 3 func_clock.html func getElementById 12 - total - 30 Elapsed times (us), FILE TYPE NAME TOTAL - total - 29 func_clock.html obj-new Date 29 Exclusive function elapsed times (us), FILE TYPE NAME TOTAL func_clock.html func setTimeout 229 func_clock.html func getElementById 378 func_clock.html func start 4061 func_clock.html func func_a 51080 func_clock.html func func_b 102943 func_clock.html func func_c 153330 - total - 312024 Inclusive function elapsed times (us), FILE TYPE NAME TOTAL func_clock.html func setTimeout 229 func_clock.html func getElementById 378 func_clock.html func func_c 153454 func_clock.html func func_b 256470 func_clock.html func func_a 307601 func_clock.html func start 312054 Counts shows us how many times each different function was called, and how many functions were called in total. The elapsed time shows us the time spent not in a JavaScript function. The exclusive function elapsed times show the time that each function spent processing code - while not in other functions. The inclusive function elapsed times show the time that each function spent processing code, including the time spent in other calls. These elapsed times are the absolute time from when the function began to when it completed - which includes off-CPU time due to other system events such as I/O, scheduling, interrupts, etc. |