|
-
Nov 3rd, 2011, 04:35 PM
#5
Re: Timer delay
That's the worst possible solution. It's what's known as a busy wait, and will take your CPU to 100% for the duration of the wait. If you run the app on a laptop, you might actually see the battery life decrease when using such a hideous construct.
The solution is to use a timer.
One option would be to enqueue all of your messages. You could even use a Queue(of T) to do this such that you would really be enqueuing them. Then, every time the timer ticked, you'd strip the next item off the queue and send it.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|