Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: timelapse
Fetching contributors…

Cannot retrieve contributors at this time

file 18 lines (18 sloc) 0.489 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Canvas 2d Context Font Property Speed</title>
</head>
<body>
  <canvas id='thecanvas' height=100 width=100/>
  <script>
    var canvas = document.getElementById('thecanvas');
    var context = canvas.getContext('2d');
    var t0 = Date.now();
    for (var i = 0; i < 1000; i++) {
      context.font = 'bold 13px Arial';
    }
    alert('Elapsed for 1000 font settings: ' + (Date.now() - t0));
  </script>
</body>
</html>
Something went wrong with that request. Please try again.