Is it possible to get the time of how long it took to send an http request in javascript? This is my code right now:
function httpGet(theUrl)
{
t = new Date().getTime()
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return new Date().getTime() - t;
}
The time in milliseconds returned is a bit inaccurate, is there a way to have a more accurate time displayed?