如睡眠5分钟,2个小时? 可以用sleep睡眠吗? 这种睡眠会占用的cpu多吗?
在时间到后怎样获取cpu呢?是自动的吗?请高手指教.

解决方案 »

  1.   

    为什么要睡眠那么他?有何用途?不如挂起再调用,sleep也可能吧!
      

  2.   

    你把线程挂起,虽你睡多久,用Thread.suspend,要唤醒用Thread.resume
      

  3.   

    TTimer的Interval类型为: Cardinal;
    Cardinal 范围0..4294967295
    1000多个小时不够吗?
      

  4.   

    关键是我用他来做一个定时器呀,没有事件,我怎们将thread.resume呢?
     TTimer有那么长吗? 莫非我看错了?见笑了
      

  5.   

    用TEvent,代码不写太长,写了又有Copy + Paste之嫌
      

  6.   

    suspend;
           sleep(1000*60);
          resume;
    我这样写可以吗?
    sleep是让其线程睡眠还是整个程序都睡眠呀?
    Sleep pauses program executions as specified by the millseconds parameter. Under Windows, Sleep is just a link to the Sleep function in the system API. Under Linux, Sleep calls the usleep library routine.
    如果让program pause 就不好了。
      

  7.   

    class(TThread).Suspend ;
    class(TThread).Resume ;
      

  8.   

    线程Suspend了,自己能Resume吗?
      

  9.   

    用sleep()方法.
    但不要忘了它是静态的方法!
    Thread.sleep(int);