WinCE下测试程序运行时间的方法

来源:互联网 发布:凸优化视频 编辑:程序博客网 时间:2024/05/17 08:34

代码如下

[DllImport("Coredll.dll", EntryPoint = "GetTickCount")]
private static extern int GetTickCount();

 

 

int dstart = GetTickCount(); 

 //这里填写要执行的代码

int dend = GetTickCount();
string strtime = (dend - dstart).ToString();
strtime += "毫秒";
MessageBox.Show(strtime);