舟行湍流

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
  static extern uint GetTickCount();
  private void button1_Click(object sender, System.EventArgs e)
  {
       uint t=GetTickCount();
       //这里是你要测试的执行过程
       uint time=GetTickCount()-t;
  }

也可以使用 TimeSpan.Milliseconds 但精度好像没有使用GetTickCount()高
posted on 2005-11-09 15:59  逆水行舟  阅读(390)  评论(0编辑  收藏  举报