JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="myCanvas" width="600" height="1000" style="border:1px solid #d3d3d3;">
</canvas>
JavaScript
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle = '#FF0000';
var startTime = $.now();
for (var i = 0; i < 1000; i++) {
ctx.rect(i,i,100,100);
}
ctx.fill();
var endTime = $.now();
console.log('Time: ' + (endTime - startTime));
ctx.stroke();