Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / canvas-font-speed-switching.html
blob8a21cf3f31c304f8bdc1a64e4b46a5591441cbe6
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <title>Canvas 2d Context Font Property Speed</title>
5 </head>
6 <body>
7 <canvas id='thecanvas' height=100 width=100/>
8 <script>
9 var canvas = document.getElementById('thecanvas');
10 var context = canvas.getContext('2d');
11 var t0 = Date.now();
12 for (var i = 0; i < 1000; i++) {
13 if(i % 2 == 0)
14 context.font = 'bold 13px Arial';
15 else
16 context.font = 'italic 13px Arial';
18 alert('Elapsed for 1000 font switches: ' + (Date.now() - t0));
19 </script>
20 </body>
21 </html>