473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Current Thread

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
5 4635
"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
* 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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Rilling | last post by:
How do I put to sleep a thread other than the current one? I want to put another thread to sleep to the specified number of milliseconds but the Sleep method seems to only work for the current...
1
by: Manu | last post by:
I have created a new culture : Dim objCulture As New CultureInfo("he") //hebrew When I tried to assign it to the current thread. Thread.CurrentThread.CurrentCulture = objCulture...
2
by: Francois Malgreve | last post by:
hello guys, I have some helper class in my ASP.NET pplication who basically contains static methods. I used them as helper methods to do small jobs that I can use at many places in my code. ...
3
by: xzzy | last post by:
A. I need to access: System.Web.HttpContext.Current.Cache but get this error: "Object reference not set to an instance of the object" B. System.Web.HttpContext.Current.Cache is accessible...
1
by: alundi | last post by:
Greetings: I'd like to post this as a new thread to an article in microsoft.public.dotnet.languages.vb originally made by nevin and replied to by Alan Pretre back in December ("ThreadState ==...
6
by: Ronchese | last post by:
Hello, is there any way to get the name of the current running procedure? For example: Public Sub Test( ) 'do something '...
2
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo()...
15
by: nelsonbrodyk | last post by:
Hey All, Just curious, does anyone know if there is a way to check if the current executing thread is the main WPF GUI thread? I want to have it so that a non-threaded remoting call will fail if...
2
by: tamirmalas | last post by:
Hi, iam trying to set a culture info different than the current culture info on the system, the code compiles fine, but nothing happens, and the system culture is the one used for the program. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.