Simple Profiler Example

In this example below you will see how to do a Simple Profiler Example with some HTML / CSS and Javascript

This awesome code was written by siriusastrebe, you can see more from this user in the personal repository.
You can find the original code on
Copyright siriusastrebe ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>Simple Profiler Example</title>


  <button onclick="profile()">Execute Large Task</button>

    <script  src="js/index.js"></script>



/*Downloaded from */
function profile() {
  var start = new Date()
  var end = new Date()
  console.log(end - start)

function largeTask () {
  for (var i = 0; i < 12345; i++) {
    var arr = new Array(12345)
    arr.fill(Math.random(), 0, 12345)