Home | History | Annotate | Download | only in XMLHttpRequest
      1 <!DOCTYPE html>
      2 <script src="../resources/runner.js"></script>
      3 <script>
      4 // Use measureTime instead of runsPerSecond to avoid a ridiculous number of requests in flight.
      5 // 100 is realistic, 1000 is plausible, but 10000 is crazy.
      6 PerfTestRunner.measureTime({
      7     description: "Measure the time it takes to create, open, and send 1000 async XMLHttpRequests",
      8     run: function() {
      9         var xhrs = [];
     10         for (var i = 0; i < 1000; ++i) {
     11             var xhr = new XMLHttpRequest();
     12             xhr.open("GET", "file" + i + ".txt", true);
     13             xhr.send();
     14             xhrs.push(xhr);
     15         }
     16     },
     17 });
     18 </script>
     19