Try/Catch Error Perf (v53)

Revision 53 of this benchmark created on


Preparation HTML

<script>

  function tryCatch(toto) {
try {nb++;}catch(uhu) {nbc--;}
if(nb>10){nbc--;}

    try {
      return undef.prop;
    } catch (ex) {
      return null;
    }
  }

  function ifCheck(toto) {
try {nb++;}catch(uhu) {nbc--;}
if(nb>10){nbc--;}

   if (undef !== undefined) {
      return undef.prop;
    }
      return null;
  }
</script>

Setup

undef=0;
    nb=0;
    nbc=0;

Test runner

Ready to run.

Testing in
TestOps/sec
If Check
ifCheck();
ready
Try Catch
tryCatch();
ready

Revisions

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