Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kieran Webster
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 88
Linux Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the thread to sleep for a period of time.
 
Kieran Webster
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic