isPrimeNumber Twsize

Benchmark created on


Preparation HTML

<script>
  var isP1 = function isPrimeNumber(a) {
      return !/^,?$|^(,,+?)\1+$/.test(Array(-~a))
      };
  
  var isP2 = function isPrimeNumberAlt(b, a) {
      for (a = b; b % --a;);
      return a < 2
      };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
isprime1
isP1(103451);
ready
isprime2
isP2(103451);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.