三个方法:
1、Sleep();
2、使用TTimer组件;
3、用GetTickCount(win32 API函数),判断两次之差大于等于5000即可。

 

API函数Sleep(60000);

 

 

DWORD Start = GetTickCount();
    while(GetTickCount() - Start < 1000*60) //等60秒
    {
      //可以在此添加60秒内需要执行的代码
      //Application->ProcessMessages();加这一句可以保证在这段时间内程序能够执行其它操作
    }

 

void Delay(DWORD DT)//DT 延时毫秒数
{
  long tt;
  while(GetTickCount()-tt<DT)
  {
    Application->ProcessMessages();
    if(GetTickCount()-tt<DT)
    {
      tt=GetTickCount();
    }
  }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-09-01
猜你喜欢
  • 2021-12-05
  • 2021-11-11
  • 2021-08-09
  • 2021-11-16
  • 2021-12-19
  • 2021-08-10
  • 2021-11-25
相关资源
相似解决方案