By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Current Thread

P: n/a
Hi,

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

MyThread.Sleep(2000)

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Mike" <y1***@yahoo.com> schrieb

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

MyThread.Sleep(2000)


System.Threading.Thread.Sleep(2000)

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
* y1***@yahoo.com (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)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

P: n/a
And maybe System.Threading.Thread.CurrentThread.Sleep(2000) too ?

Bismark

"Mike" <y1***@yahoo.com> a écrit dans le message de
news:93**************************@posting.google.c om...
Hi,

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

MyThread.Sleep(2000)

Thanks

Nov 20 '05 #4

P: n/a
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

"Bismark Prods" <tr*******@vtxnet.ch> wrote in message
news:c6**********@newshispeed.ch...
And maybe System.Threading.Thread.CurrentThread.Sleep(2000) too ?

Bismark

"Mike" <y1***@yahoo.com> a écrit dans le message de
news:93**************************@posting.google.c om...
Hi,

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

MyThread.Sleep(2000)

Thanks


Nov 20 '05 #5

P: n/a
That makes the opposite ! Now i'm confused !

Bismark

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> a écrit dans le
message de news:%2***************@TK2MSFTNGP10.phx.gbl...
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

"Bismark Prods" <tr*******@vtxnet.ch> wrote in message
news:c6**********@newshispeed.ch...
And maybe System.Threading.Thread.CurrentThread.Sleep(2000) too ?

Bismark

"Mike" <y1***@yahoo.com> a écrit dans le message de
news:93**************************@posting.google.c om...
Hi,

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

MyThread.Sleep(2000)

Thanks



Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.