🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages Started by Warren Stewart Thu, 13 Mar 2003 23:21
Sleep, Wait or Pause Function?
#17533
Author: Warren Stewart
Date: Thu, 13 Mar 2003 23:21
6 lines
1066 bytes
Hi All:
Is there a system call to pause a program's execution for a few
miliseconds.  Something like sleep(500), or wait(500) to make app
suspend execution for 500 ms?  I'm using CBuilder 5 Pro.
Thanks.
Warren Stewart
Re: Sleep, Wait or Pause Function?
#17534
Author: Ron Sommer
Date: Thu, 13 Mar 2003 23:52
16 lines
1422 bytes
> Is there a system call to pause a program's execution for a few
> miliseconds.  Something like sleep(500), or wait(500) to make app
> suspend execution for 500 ms?  I'm using CBuilder 5 Pro.


Strange question. How about Sleep(500):

The Sleep function suspends the execution of the current thread for a 
specified interval.

VOID Sleep(
     DWORD dwMilliseconds 	// sleep time in milliseconds
    );	


Ron Sommer
Re: Sleep, Wait or Pause Function?
#17536
Author: Remy Lebeau (TeamB)
Date: Fri, 14 Mar 2003 00:10
11 lines
1263 bytes
Use Sleep() (uppercase 'S')


Gambit

"Warren Stewart" <stewtech@sbcglobal.net> wrote in message
news:3E711275.6C06527A@sbcglobal.net...

> Is there a system call to pause a program's execution
> for a few miliseconds.  Something like sleep(500), or
> wait(500) to make app suspend execution for 500 ms?
Re: Sleep, Wait or Pause Function?
#17538
Author: Brent
Date: Fri, 14 Mar 2003 02:59
10 lines
1291 bytes
Sleep(500);

"Warren Stewart" <stewtech@sbcglobal.net> wrote in message
news:3E711275.6C06527A@sbcglobal.net...
> Hi All:
> Is there a system call to pause a program's execution for a few
> miliseconds.  Something like sleep(500), or wait(500) to make app
> suspend execution for 500 ms?  I'm using CBuilder 5 Pro.
> Thanks.
> Warren Stewart
Re: Sleep, Wait or Pause Function?
#17563
Author: Early Ehlinger
Date: Fri, 14 Mar 2003 14:41
22 lines
1955 bytes
"Warren Stewart" <stewtech@sbcglobal.net> wrote:
> Something like sleep(500), or wait(500) to make app
> suspend execution for 500 ms?

Depends on what you mean by 500 ms.  If you mean precisely 500 ms, as in you
want something to happen exactly every 1/2 second, then the answer is 'no'.
If you mean at *least* 500 ms, then the answer is:

Sleep( 500 );

The reason is that b/c the Win32 family of operating systems are all
pre-emptive, non-realtime OS's, the best guarantee they can offer is that
your thread will not get the processor for at least the amount of time you
tell the OS you want your thread to be out of the queue.

--
-- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 --
- RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects -
--- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour --
----------------- SuperComputing For the Masses! ----------------
"I'm so busy programming my computer to let me be lazy, I never
get any rest!" - John Kaster
Re: Sleep, Wait or Pause Function?
#17547
Author: Warren Stewart
Date: Fri, 14 Mar 2003 17:41
13 lines
1304 bytes
Thanks to all. I didn't find "Sleep" in online help. So wasn't sure if
that was the right function.
WS


Warren Stewart wrote:
> 
> Hi All:
> Is there a system call to pause a program's execution for a few
> miliseconds.  Something like sleep(500), or wait(500) to make app
> suspend execution for 500 ms?  I'm using CBuilder 5 Pro.
> Thanks.
> Warren Stewart
Re: Sleep, Wait or Pause Function?
#17549
Author: Remy Lebeau (TeamB)
Date: Fri, 14 Mar 2003 20:21
11 lines
1329 bytes
Sleep() is indeed documented in the online help.  However, in Microsoft's
help files, not Borland's, as it is a Win32 API function, not a Borland
function.


Gambit

"Warren Stewart" <stewtech@sbcglobal.net> wrote in message
news:3E72144C.B834A9A7@sbcglobal.net...
> Thanks to all. I didn't find "Sleep" in online help. So
> wasn't sure if that was the right function.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads