5 个解决方案
#1
对有疑问的每个函数做如下处理,
fun1()
{
DataTime begintime = DateTime.Now;
Console.WriteLine("{0}: begin at {1}","fun1",begintime.ToString);
........
DataTime endtime = DateTime.Now;
Console.WriteLine("{0}: end at {1}","fun1",endtime.ToString);
}
运行结束时观察调试窗口的输出结果。
fun1()
{
DataTime begintime = DateTime.Now;
Console.WriteLine("{0}: begin at {1}","fun1",begintime.ToString);
........
DataTime endtime = DateTime.Now;
Console.WriteLine("{0}: end at {1}","fun1",endtime.ToString);
}
运行结束时观察调试窗口的输出结果。
#2
太不精确了,每个函数需要调用上万次,而每次可能运行时间不到一个 Tick.
#3
你要很精确有什么用途吗?
#4
管理工具->性能,添加相应的监视
#5
system.management里面看一下能否实现.一般在那里面应该有的.
#1
对有疑问的每个函数做如下处理,
fun1()
{
DataTime begintime = DateTime.Now;
Console.WriteLine("{0}: begin at {1}","fun1",begintime.ToString);
........
DataTime endtime = DateTime.Now;
Console.WriteLine("{0}: end at {1}","fun1",endtime.ToString);
}
运行结束时观察调试窗口的输出结果。
fun1()
{
DataTime begintime = DateTime.Now;
Console.WriteLine("{0}: begin at {1}","fun1",begintime.ToString);
........
DataTime endtime = DateTime.Now;
Console.WriteLine("{0}: end at {1}","fun1",endtime.ToString);
}
运行结束时观察调试窗口的输出结果。
#2
太不精确了,每个函数需要调用上万次,而每次可能运行时间不到一个 Tick.
#3
你要很精确有什么用途吗?
#4
管理工具->性能,添加相应的监视
#5
system.management里面看一下能否实现.一般在那里面应该有的.