- function getPerformance() {
- var f = "";
- var e = "";
- var d;
- var b = "";
- f = window.performance;
- var a = f.timing;
- d = a.navigationStart;
- if (typeof a.secureConnectonStart == "undefined") {
- a.secureConnectonStart = "-"
- }
- b = new Date();
- for (var c in a) {
- if ((a[c] != "0") && (a[c] != "-")) {
- if ((a[c] - b > diffTime) || (b - a[c]) > diffTime) {
- return null
- }
- }
- }
- e = a.navigationStart + "|" + a.redirectStart + "|" + a.redirectEnd + "|" + a.fetchStart + "|" + a.domainLookupStart + "|" + a.domainLookupEnd + "|" + a.connectStart + "|" + a.secureConnectonStart + "|" + a.connectEnd + "|" + a.requestStart + "|" + a.responseStart + "|" + a.unloadEventStart + "|" + a.unloadEventEnd + "|" + a.responseEnd + "|" + a.domLoading + "|" + a.domInteractive + "|" + a.domContentLoadedEventStart + "|" + a.domContentLoadedEventEnd + "|" + a.domComplete + "|" + a.loadEventStart + "|" + a.loadEventEnd + "&cTime=" + d;
- return e
- }
- //该片段来自于http://www.codesnippet.cn/detail/2008201513501.html
来源: http://www.codesnippet.cn/detail/2008201513501.html