2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / profiler / start-and-stop-profiling-in-the-same-function.html
blob5faaf7475615d2937c9e7aca064b79cefeb08193
1 <html>
2 <head>
3 <script src="resources/profiler-test-JS-resources.js"></script>
4 <script>
5 if (window.layoutTestController) {
6 layoutTestController.dumpAsText();
7 layoutTestController.setJavaScriptProfilingEnabled(true);
10 function startTest()
12 console.profile("Profiling From A Nested Location");
14 functionWichStopsTheProfiler();
17 function functionWichStopsTheProfiler()
19 for (var i = 0; i < 10000000; i++)
20 var b = i + 2;
22 console.profileEnd("Profiling From A Nested Location");
23 printProfilesDataWithoutTime();
26 </script>
27 </head>
29 <body onload="startTest()">
30 This page's JavaScript starts profiling from within a nested location.
31 <br>
32 <br>
33 To run this test manually, load it in the browser then load the WebInspector and look at
34 the profile. In the profile there should be a call to functionWichStopsTheProfiler().
35 <div id="output"></div>
36 </body>
37 </html>