|
[code=html] <script type="text/javascript">
var st = new Date();
</script>
<img height="300" alt="测试图片" src="http://t2.baidu.com/it/u=2486227231,3384881016&fm=25&gp=0.jpg"
width="400">
<script type="text/javascript">
function showspeed() {
var fs =9594 //1.46 * 1024; //img.jpg文件大小(K)
var l = 2; //小数点的位数
var et = new Date();
alltime = fs * 1000 / (et - st)
Lnum = Math.pow(10, l)
calcspeed = Math.round(alltime * Lnum) / Lnum
showtxt.innerHTML = ("您的下载速度为:" + calcspeed + " (K/秒)")
}
</script>[/code] |
|