mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-26 13:44:24 +00:00
31 lines
897 B
HTML
31 lines
897 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||
|
<script>
|
||
|
$( window ).load(function() {
|
||
|
|
||
|
var canvas = $('#cnv')[0];
|
||
|
var ctx = canvas.getContext('2d');
|
||
|
var loops = 0;
|
||
|
var startTime = +Date.now();
|
||
|
function drawRect() {
|
||
|
setTimeout(function() {
|
||
|
//ctx.fillStyle = '#FF0000';
|
||
|
//ctx.fillRect(100, 100, 100, 100);
|
||
|
loops++;
|
||
|
if(loops < 1000) {
|
||
|
drawRect();
|
||
|
} else {
|
||
|
var endTime = +Date.now();
|
||
|
alert(endTime-startTime);
|
||
|
}
|
||
|
}, 0);
|
||
|
};
|
||
|
drawRect();
|
||
|
});
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<canvas id="cnv" width="300" height="300"></canvas>
|
||
|
</body>
|
||
|
</html>
|