Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / read_cookies.html
blobb457c34e8ba923ba31bf93c8c2cf5ee05228b8ed
1 <html>
2 <body>
3 <pre>
4 <script>
6 // This script tests the performance of reading cookies. It sets a cookie and
7 // then reads cookies N times. Finally, it outputs the average time taken to
8 // read the cookie.
10 document.cookie =
11 'one_heck_of_a_crazy_cookie_name=1234567890.1234567890.1234567890.1234567890';
13 var ok = true;
15 var num_iters = document.location.search.substring(1) - 0;
16 if (num_iters == 0)
17 num_iters = 10000;
18 document.writeln("num_iters: " + num_iters);
20 var ts = (new Date()).getTime();
22 // read the cookie num_iters times
23 for (var i = 0; i < num_iters; ++i) {
24 var d = document.cookie;
27 var te = (new Date()).getTime();
29 var time_per_read = (te - ts) / num_iters;
30 document.writeln("time per read: " + time_per_read.toFixed(3) + " msec");
32 </script>
33 </pre>
34 </body>
35 </html>