Thanks every one for your inputs.
Now I am using timer instead of sleep API.
Pankaj
-----Original Message-----
From: John Walborn [mailto:Jwalborn@m...]
Sent: Friday, October 25, 2002 1:18 AM
To: professional vb
Subject: [pro_vb] Re: halt for while
Hog? It'll FREEZE your CPU.
-----Original Message-----
From: Marco Straforini [mailto:marco.straforini@c...]
Sent: Thursday, October 24, 2002 2:41 PM
To: professional vb
Subject: [pro_vb] Re: halt for while
The problem with using the Sleep API (and in fact it is discouraged
in any GUI applications) is that it makes your application
irresponsive for 10 seconds, and that can aggravate the user...
If you cannot use a timer (this is what the timer is for) you
can use a smaller amount of sleep (let's say 1 seconds) in a for
loop together with a DoEvents (how I hate it, but c'est la vie)
Do not put a DoEvents in a tight loop! It will hog your cpu.
Marco
> Use the sleep API
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds
As Long)
HTH
Satya
---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills
from Visual Basic 6 to C#, the language of choice
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills
from Visual Basic 6 to C#, the language of choice
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
**********************************************************************
This message and any attachments are intended for the
individual or entity named above. If you are not the intended
recipient, please do not forward, copy, print, use or disclose this
communication to others; also please notify the sender by
replying to this message, and then delete it from your system.
The Timken Company
**********************************************************************