1:
[DllImport("Kernel32.dll")]
public static extern UInt32 GetTickCount();
private void int GetVal()
{
UInt32 Start = GetTickCount();
{
//doing.......
}
UInt32 End = GetTickCount();
return (End - Start);
}
2:
DateTime Start = DateTime.Now;
{
//doing......
}
return DateTime.Now.Subtract(dt).Milliseconds.ToString();
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/archive/2010/03/29/1699820.html,如需转载请自行联系原作者