js0001

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>

<head>
<title>A simple performance counter</title>
<script>
maxCount = 10000;
console.time("My operation");
for (var n = 0; n < maxCount; n++) {
/*perform the operation to be measured*/ //#B
}
console.timeEnd("My operation");
</script>

</head>

<body>
Outputs to the console (press F12)
</body>

</html>