C++60秒计时问题
想写个交通灯的代码,要控制红灯亮60秒,这种计时问题怎么写呀 C++ 定时
[解决办法]
C++Builder,拖一个TTimer组件到窗体即可。
[解决办法]
procedure Sleep(ATime: cardinal);
Parameters
ATime: cardinal
The number of milliseconds to sleep.
Description
Sleep is a procedure used to suspend the current thread of execution for the number of milliseconds specified in ATime. While the current thread is suspended, control passes to other processes with an equal or higher priority.
Sleep encapsulates the platform-specific procedures or functions used to suspend the current thread of execution. For the Windows platform, the procedure used is Windows.Sleep. On the Linux platform, Sleep tries to select a non-existent socket handle for the specified number of milliseconds.