0

是否有任何API可以找出网页的加载时间?还有哪些其他方法可以找出网页的加载时间?

4

1 回答 1

0

参考http://www.hashemian.com/tools/page-load-time.htm

这是简单的 JavaScript 网页加载时间代码(复制并粘贴到网页顶部):

<script language="JavaScript">
PLT_DisplayFormat = "Your connection took %%S%% seconds to load this page.";
PLT_BackColor = "palegreen";
PLT_ForeColor = "navy";
PLT_FontPix = "12";
PLT_DisplayElementID = "display_here";
</script>
<script language="JavaScript" src="http://www.hashemian.com/js/PageLoadTime.js"></script>

示例:下面的行编码为: 。

Your connection took 8.486 seconds to load this page.

于 2012-07-10T05:51:41.010 回答