Archive

Posts Tagged ‘vb’

Putting VB.Net (2008) to sleep

May 6th, 2009 NothingMan No comments

While working on my geo-coding experiment, I realized that the Google web service stops allowing requests after a certain amount of submittals in a certain amount of time. I’d get about 30 successful results and then about 10-15 unsuccessful results.

The easiest way I could solve this problem was to send n requests and then sleep for a few seconds, and then continue.

So, this is how you put the program to sleep:

Add this code:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

And call it like this:
Sleep(2000)

VN:F [1.9.1_1087]

Rating: 3.0/5 (1 vote cast)
VN:F [1.9.1_1087]
Rating: +1 (from 1 vote)
Categories: Code, Tips Tags: , , , , ,