var sw = new Stopwatch(); //使用Stopwatch类计算
sw.Reset(); //重置测量时间
sw.Start(); //开始计算
for (var i = 0; i < 100; i++)
{
ComInput comInput = null;
var agentW = new AgentW();
comInput = ComInput.GetComInput();
comInput.SetPm("field1", Guid.NewGuid().ToString());
comInput.SetPm("field2", Guid.NewGuid().ToString());
agentW.Cmd("BLL.DTS.Affairs.Test.Insert", comInput);
}
sw.Stop(); //终止计算
Response.Write(sw.ElapsedMilliseconds + " ms \t\t");//打印时间
sw.Reset(); //重置测量时间
sw.Start(); //开始计算
for (var i = 0; i < 100; i++)
{
ComInput comInput = null;
var agentW = new AgentW();
comInput = ComInput.GetComInput();
comInput.SetPm("field1", Guid.NewGuid().ToString());
comInput.SetPm("field2", Guid.NewGuid().ToString());
agentW.Cmd("BLL.DTS.Affairs.Test.Insert", comInput);
}
sw.Stop(); //终止计算
Response.Write(sw.ElapsedMilliseconds + " ms \t\t");//打印时间