Simple Profiler Example

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

Thumbnail
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 Codepen.io
Copyright siriusastrebe ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

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

<body>

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

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




</body>

</html>

/*Downloaded from https://www.codeseek.co/siriusastrebe/simple-profiler-example-NdaBNx */
function profile() {
  var start = new Date()
  largeTask()
  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)
    arr.sort()
  }
}

Comments