Fiddler添加请求时间_PHP处理时间:请求时间用于显示是在什么时间请求服务器的,主要用于看服务器性能。
代码:
找到以下代码并复制红色代码:
// You can create a custom menu like so:
/*
QuickLinkMenu("&Links")
QuickLinkItem("IE GeoLoc TestDrive", "http://ie.microsoft.com/testdrive/HTML5/Geolocation/Default.html")
QuickLinkItem("FiddlerCore", "http://fiddler2.com/fiddlercore")
public static function DoLinksMenu(sText: String, sAction: String)
{
Utilities.LaunchHyperlink(sAction);
}
*/
function BeginRequestTime(oS: Session)
{
if (oS.Timers != null)
{
return oS.Timers.ClientBeginRequest.ToString();
}
return String.Empty;
}
public static BindUIColumn("TimeTaken", 145)
function CalcTimingCol(oS: Session)
{
var sResult = String.Empty;
if ((oS.Timers.ServerDoneResponse > oS.Timers.ClientDoneRequest))
{
sResult = (oS.Timers.ServerDoneResponse - oS.Timers.ClientDoneRequest).TotalMilliseconds.ToString("#0");//不要小数点后的数
}
var th = oS.Timers.ClientDoneRequest.Hour;
var tm = oS.Timers.ClientDoneRequest.Minute;
var ts = oS.Timers.ClientDoneRequest.Second;
var tms= oS.Timers.ClientDoneRequest.Millisecond ;
return th + ':' + tm + ':' + ts + '/' + tms + '_' + sResult + " ms";
}
public static RulesOption("Hide 304s")
BindPref("fiddlerscript.rules.Hide304s")
var m_Hide304s: boolean = false;
|