Home arrow static arrow Java Programming [Archive] - sleep
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - sleep
This topic has 1 reply on 1 page.

Posts:79
Registered: 9/27/03
sleep  
Jun 29, 2004 2:58 AM



 
Hey!

This:
            for(int i=0;i<10;i++) {                s.send(hi);                sleep(200);            }


should send hi once and then wait for 2 seconds and then send it agin and so on 10 times, rigth?

But instead it waits for 2 seconds and then sed it 10 times.

Any ideas?
 

Posts:2,909
Registered: 13.8.2003
Re: sleep  
Jun 29, 2004 3:00 AM (reply 1 of 1)



 
2000 milliseconds is 2 seconds, so fix your code.
 
This topic has 1 reply on 1 page.