Javascript iframe loading time function for many urls
<p>Got a very simple function that checks the loading time of an iframe:</p>

<pre><code>function loadTime() {
        var beforeLoad = (new Date()).getTime();        
        $('#loading_iframe').one('load', function () {
            var afterLoad = (new Date()).getTime();
            var result = (afterLoad - beforeLoad) / 1000;
            $("#loadingtime").html(result + " sec");
        }); 
    }   
</code></pre>

<p>I load my frame like so (where $url = some link)):</p>

<pre><code>&lt;iframe style="visibility:hidden;display:none" id="loading_iframe" src="&lt;?php echo $url;?&gt;"&gt;&lt;/iframe&gt;
</code></pre>

<p>After that i put my result into a div:</p>

<pre><code>&lt;div id="loadingtime"&gt;&lt;/div&gt;
</code></pre>

<p>This works very well for one single url, i want it to work for an array of urls. Heres the structure i would like to have(is this possible?):</p>

<pre><code>foreach ($url_array as $i)
  iframe gets loaded with url
    javascript that gets the loadtime of the url
      passint the javascript value to php varriable
        write the php varriable to a database
close foreach and begin the next loop
</code></pre>
