testing client bandwidth with asp.net mvc <p>I want calculating client bandwidth in asp.net mvc and already I used JavaScript</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; time = new Date(); time1 = time.getTime(); &lt;/script&gt; &lt;!-- Dummy Text to measure transfer speed --&gt; &lt;script language="javascript" type="text/javascript"&gt; time = new Date(); time2 = time.getTime(); ttime = time2 - time1; if (ttime == 0) ttime = .1; ttime = ttime / 1000; //thousand mili seconds kbps = 45 / ttime; kbps = kbps * 8; // multiply by 8 to make kiloBITS instead of kiloBYTES kbps = Math.round (kbps); document.getElementById("lblBandwidth").innerHTML=kbps + " kbps"; &lt;/script&gt; </code></pre> <p>you can see this on <a href="http://www.whoismaster.ir/Home/BandwidthMeter" rel="nofollow">http://www.whoismaster.ir/Home/BandwidthMeter</a> but this is not accurate</p> <p>how can used accurate code for this? I like used asp.net mvc with c# for exactly bandwidth</p>