Current Thread

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

How I can get access to current thread.
I want to pause it for some seconds.

MyThread.Sleep(2000)

Thanks
 
* (e-mail address removed) (Mike) scripsit:
How I can get access to current thread.
I want to pause it for some seconds.

MyThread.Sleep(2000)

'System.Threading.Thread.Sleep(2000)'.
 
And maybe System.Threading.Thread.CurrentThread.Sleep(2000) too ?

Bismark
 
Bismark,
Sleep is a shared method!

Although its allowed, calling Shared methods on an instance variable can be
confusing!

For example:

Dim worker As New Thread(AddressOf Work)
worker.Start()
worker.Sleep(500)

Which thread is put to sleep, the current thread or the worker thread?

Hope this helps
Jay
 

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


Back
Top