forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole-time.html
33 lines (32 loc) · 1.23 KB
/
console-time.html
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
29
30
31
32
33
<script>
function test() {
// Test 1: call timeEnd before time
console.log(">>>console.timeEnd(\"1\")");
console.timeEnd("1");
// Test 2: call time two times before timeEnd
console.log(">>>console.time(\"2\")");
console.time("2");
setTimeout(function() {
console.log(">>>console.time(\"2\")");
console.time("2");
console.log(">>>console.timeEnd(\"2\")");
console.timeEnd("2");
console.log("2: If it says ~1000ms the first time is not overwritten.");
}, 1000);
// Test 3: call timeEnd two times
console.log(">>>console.time(\"3\")");
console.time("3");
console.log(">>>console.timeEnd(\"3\")");
console.timeEnd("3");
console.log(">>>console.timeEnd(\"3\")");
console.timeEnd("3");
// Test 4: call time/timeEnd without title parameter
console.log(">>>console.time()");
console.time();
console.log(">>>console.timeEnd()");
console.timeEnd();
};
</script>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19159">Bug 19159: Inspector should support console.time/console.timeEnd</a>.</p>
<p>Open the Inspector (right-click and choose "Inspect Element"), then click the "Run Tests" button.</p>
<button onclick="test()">Run Tests</button>