Home Demos Forum Research Guide
Viewing topic in forum 'general'
back to topic list

Thread sleep
How do I make a thread sleep. Couldn't find it in the programming guide. Thanks! - Ralph
by adetolaraphael on 2015-03-11 12:34:46 (1 reply)

Hi Ralph,

You can do that using the time.Timer interface/component.


component provides App requires io.Output out, data.IntUtil iu, time.Timer t {
  int App:main(AppParam params[]) {
        while (true) {
            t.sleep(10000);// 10 secs
            out.println("Test!");
        }
        return 0;
    }  
}
 


Remember that the time is in milliseconds. That means 1000 is 1 sec.

If you could give us more details maybe I could come up with different ways to help you.

I hope this helps.

- Roberto
by roberto on 2015-03-11 12:39:34
© Francis Research Ltd. 2018