Delaying application

K

Krakatioison

I am running a loop which I need to pause for 3 seconds, at the end of each
cycle.

I found somewhere to use threads.delay(), but I am not using any threads and
when I typed it in, it wasn't even recognized as a command.

So what I am doing now is this:

for a = 0 to 15000
dim d as integer = a*a
next

This will delay the run of the next cycle for like 2-3 secs, but it's taking
all my cpu power and slows down the machine like crazy.

I need some workaround which wouldn't slow down my machine and would work as
a delay method for vb.net.

Thanks a lot for all your answers.

Sincerely,
K.
 
L

Lucas Tam

I found somewhere to use threads.delay(), but I am not using any
threads and when I typed it in, it wasn't even recognized as a
command.

System.Threading.Thread.Sleep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top