File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How would I create a timer in a for loop? [RESOLVED] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How would I create a timer in a for loop? [RESOLVED]" Watch "How would I create a timer in a for loop? [RESOLVED]" New topic
Author

How would I create a timer in a for loop? [RESOLVED]

Kieran Webster
Greenhorn

Joined: Jan 13, 2013
Posts: 22



Basically I'm using an IRC bot to send messages to random users in the channel, and the server/channel has capped how fast you can change the target.

How would I create a time in between each message in order to avoid the error from the server.

EDIT: Never mind sorry, I used Thread.sleep(#);

Mack Wilmot
Ranch Hand

Joined: Jul 27, 2011
Posts: 88

Put the thread to sleep for a period of time.
Kieran Webster
Greenhorn

Joined: Jan 13, 2013
Posts: 22
Mack Wilmot wrote:Put the thread to sleep for a period of time.


Just this second tried that and edited the post. Thanks though.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38350
    
  23
Kieran Webster wrote: . . . Just this second tried that and edited the post. . . .
No, no, no, no. no.

Don’t edit posts like that after a reply. It makes the rest of the thread read like nonsense.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How would I create a timer in a for loop? [RESOLVED]