title: function efficiency measuring javascript
body: <p>I would like to check the efficiency of my functions, let's say to find a prime number, I wrote something like:</p>
  
  <pre><code>var counter = 0;
  var myVar = setInterval(myTimer, 10)
  function myTimer() {counter++}
  
  //Function to be accessed
  function isPrime(num){
      my function
  }
  
  var prime = isPrime(x);
  clearInterval(myVar);
  console.log(counter);
  </code></pre>
  
  <p>My problem is that <code>counter = 0</code>in the end</p>
  
  <p>Interestingly it would work if I would make an action with the timer, for example getting an html element and increase it's value.  </p>
  
  <p>Any idea?</p>
  
  <p>thanks</p>