diff options
| author | s1n <[email protected]> | 2020-03-28 10:31:08 -0700 |
|---|---|---|
| committer | s1n <[email protected]> | 2020-03-28 10:31:08 -0700 |
| commit | 6b81836e6b9815a2996a55ad37dcaa4d89f99e42 (patch) | |
| tree | 74bb9aa78ca31a6acfffd908e34dfb0df433c707 /js/performance-stats.js | |
| parent | Create .gitignore (diff) | |
| download | cyne.cf-backup-master.tar.xz cyne.cf-backup-master.zip | |
Diffstat (limited to 'js/performance-stats.js')
| -rw-r--r-- | js/performance-stats.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/performance-stats.js b/js/performance-stats.js new file mode 100644 index 0000000..f9762d8 --- /dev/null +++ b/js/performance-stats.js @@ -0,0 +1,26 @@ +var stats = new Stats(); +stats.setMode(0); +document.body.appendChild(stats.domElement); + +var canvas = document.createElement('canvas'); +canvas.width = 512; +canvas.height = 512; +document.body.appendChild(canvas); + +var context = canvas.getContext('2d'); +context.fillStyle = 'rgba(127,0,255,0.05)'; +setInterval(function () { + var time = Date.now() * 0.001; + context.clearRect(0, 0, 512, 512); + stats.begin(); + for (var i = 0; i < 2000; i++) { + var x = Math.cos(time + i * 0.01) * 196 + 256; + var y = Math.sin(time + i * 0.01234) * 196 + 256; + context.beginPath(); + context.arc(x, y, 10, 0, Math.PI * 2, true); + context.fill(); + // DO NOT ENABLE THIS LMAO + // document.write("Text to display."); + } + stats.end(); +}, 1000 / 60);
\ No newline at end of file |