Is there a Sleep function?? 
Author Message
 Is there a Sleep function??

Hello,

        I would like to have a built in delay call, as suppose to using a
counter so I would not slow down the CPU.

Is there a Sleep, Wait, Delay, or similar command that is not documented
in VBScript for WSH?

Thanks

Youssef



Tue, 31 Jul 2001 03:00:00 GMT  
 Is there a Sleep function??
There is no sleep function available in WSH. But there are several ActiveX
controls out there. Have a look at C. Washingtons site (he offer a control).

Http://cwashington.netreach.net

I wrote also a control for this and other purposes (WSHExtend). Hope I have
time to release the OCX file within the next days on my web site. The whole
stuff including the source code will be released within my WSH book (see
below).

G. Born

Author of: Windows Scripting Host Tutorial, (see www.wrox.com  in the future
publishing list)

check out also the "Windows Scripting Host Bazaar" in the Hot Zone of my
english web site for further WSH script samples and useful stuff:

http://ourworld.compuserve.com/homepages/Guenter_Born


Quote:
>Hello,

> I would like to have a built in delay call, as suppose to using a
>counter so I would not slow down the CPU.

>Is there a Sleep, Wait, Delay, or similar command that is not documented
>in VBScript for WSH?

>Thanks

>Youssef



Tue, 31 Jul 2001 03:00:00 GMT  
 Is there a Sleep function??

No, you have to use an external control for this. I have a simple one on my site for free. Additionally www.serverobjects.com has one called Waitfor that is much more robust.

Clarence

--
Check it out..

Http://cwashington.netreach.net

On this site you will find resources for all of your scripting needs.
Everything you need to get up and running. Over 100 Sample
Scripts, ActiveX controls, reference materials, and technical support
via an online discussion lounge.

[ Win32Scripting... automate!! ]


Hello,

I would like to have a built in delay call, as suppose to using a
counter so I would not slow down the CPU.

Is there a Sleep, Wait, Delay, or similar command that is not documented
in VBScript for WSH?

Thanks

Youssef



Wed, 01 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
You may try to use sleep.exe from NT Reskit. This one example will suspent
execution of vbscript to 5 second.

Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run("cmd /c sleep 5", 0, True)


Quote:
>Hello,

> I would like to have a built in delay call, as suppose to using a
>counter so I would not slow down the CPU.

>Is there a Sleep, Wait, Delay, or similar command that is not documented
>in VBScript for WSH?

>Thanks

>Youssef



Thu, 02 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
By Popular Demand, I've added a "sleep" command to the next version of WSH,
which will ship with Windows 2000 and will be available for download on the
web shortly afterwards.

Eric


Quote:
> You may try to use sleep.exe from NT Reskit. This one example will suspent
> execution of vbscript to 5 second.

> Dim WSHShell
> Set WSHShell = CreateObject("WScript.Shell")
> WSHShell.Run("cmd /c sleep 5", 0, True)


> >Hello,

> > I would like to have a built in delay call, as suppose to using a
> >counter so I would not slow down the CPU.

> >Is there a Sleep, Wait, Delay, or similar command that is not documented
> >in VBScript for WSH?

> >Thanks

> >Youssef



Fri, 03 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
Couldn't you just use a Loop structure to simulate a Sleep/Delay
function?

psuedocode example:
Sleep procedure (N_Seconds)
Start0 = Now
Stop0 = Start0 + N_Seconds
Loop Until Now() => Stop0
    do something, Yawn!
end Loop
end Sleep procedure

'/* This uses the system clock and a Stop0 variable to tell the Loop
when to stop executing.  The Start0 variable is used with the system
clock (use a Now/Time function) to define the Stop0 variable.  The "do
something, Yawn!" isn't really necessary, just a habit (there's
usually code within a Loop structure, but it's not required).  */

See your manuals for VBScripting syntax.  I used psuedocode so I
wouldn't accidentally handicap you with syntax errors.

On Sun, 14 Feb 1999 20:51:45 +0300, "Michael Lopyrev"

Quote:

>You may try to use sleep.exe from NT Reskit. This one example will suspent
>execution of vbscript to 5 second.

>Dim WSHShell
>Set WSHShell = CreateObject("WScript.Shell")
>WSHShell.Run("cmd /c sleep 5", 0, True)


>>Hello,

>> I would like to have a built in delay call, as suppose to using a
>>counter so I would not slow down the CPU.

>>Is there a Sleep, Wait, Delay, or similar command that is not documented
>>in VBScript for WSH?

>>Thanks

>>Youssef


Access 97 Programmer/Consultant
http://home.att.net/~highlander001


Fri, 03 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
This is a commonly used solution that bothers a lot of folks because it
spikes the CPU at 100%.

--
Mike Harris


|Couldn't you just use a Loop structure to simulate a Sleep/Delay
|function?
|
|psuedocode example:
|Sleep procedure (N_Seconds)
|Start0 = Now
|Stop0 = Start0 + N_Seconds
|Loop Until Now() => Stop0
|    do something, Yawn!
|end Loop
|end Sleep procedure
|
|'/* This uses the system clock and a Stop0 variable to tell the Loop
|when to stop executing.  The Start0 variable is used with the system
|clock (use a Now/Time function) to define the Stop0 variable.  The "do
|something, Yawn!" isn't really necessary, just a habit (there's
|usually code within a Loop structure, but it's not required).  */
|
|See your manuals for VBScripting syntax.  I used psuedocode so I
|wouldn't accidentally handicap you with syntax errors.
|
|
|On Sun, 14 Feb 1999 20:51:45 +0300, "Michael Lopyrev"
|>You may try to use sleep.exe from NT Reskit. This one example will suspent
|>execution of vbscript to 5 second.
|>
|>
|>Dim WSHShell
|>Set WSHShell = CreateObject("WScript.Shell")
|>WSHShell.Run("cmd /c sleep 5", 0, True)
|>
|>

|>>Hello,
|>>
|>> I would like to have a built in delay call, as suppose to using a
|>>counter so I would not slow down the CPU.
|>>
|>>Is there a Sleep, Wait, Delay, or similar command that is not documented
|>>in VBScript for WSH?
|>>
|>>Thanks
|>>
|>>Youssef
|>
|>
|

|Access 97 Programmer/Consultant
|http://home.att.net/~highlander001



Fri, 03 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
You could, but that would massively slow down anything else running on your
machine -- the CPU spends 100% of its time checking to see if it should stop
running.  A properly implemented sleep command puts the thread into a wait
state, and the operating system knows that it can use the CPU for other
tasks while the thread is sleeping.

Eric


Quote:
> Couldn't you just use a Loop structure to simulate a Sleep/Delay
> function?

> psuedocode example:
> Sleep procedure (N_Seconds)
> Start0 = Now
> Stop0 = Start0 + N_Seconds
> Loop Until Now() => Stop0
>     do something, Yawn!
> end Loop
> end Sleep procedure

> '/* This uses the system clock and a Stop0 variable to tell the Loop
> when to stop executing.  The Start0 variable is used with the system
> clock (use a Now/Time function) to define the Stop0 variable.  The "do
> something, Yawn!" isn't really necessary, just a habit (there's
> usually code within a Loop structure, but it's not required).  */

> See your manuals for VBScripting syntax.  I used psuedocode so I
> wouldn't accidentally handicap you with syntax errors.

> On Sun, 14 Feb 1999 20:51:45 +0300, "Michael Lopyrev"

> >You may try to use sleep.exe from NT Reskit. This one example will
suspent
> >execution of vbscript to 5 second.

> >Dim WSHShell
> >Set WSHShell = CreateObject("WScript.Shell")
> >WSHShell.Run("cmd /c sleep 5", 0, True)


> >>Hello,

> >> I would like to have a built in delay call, as suppose to using a
> >>counter so I would not slow down the CPU.

> >>Is there a Sleep, Wait, Delay, or similar command that is not documented
> >>in VBScript for WSH?

> >>Thanks

> >>Youssef


> Access 97 Programmer/Consultant
> http://home.att.net/~highlander001



Fri, 03 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
You are absolutely correct.  Now, how would you implement this using
VScript - the current version, not a beta or upcoming version .)

On Mon, 15 Feb 1999 17:29:48 -0800, "Eric Lippert (Microsoft Scripting

Quote:

>You could, but that would massively slow down anything else running on your
>machine -- the CPU spends 100% of its time checking to see if it should stop
>running.  A properly implemented sleep command puts the thread into a wait
>state, and the operating system knows that it can use the CPU for other
>tasks while the thread is sleeping.

>Eric



>> Couldn't you just use a Loop structure to simulate a Sleep/Delay
>> function?

>> psuedocode example:
>> Sleep procedure (N_Seconds)
>> Start0 = Now
>> Stop0 = Start0 + N_Seconds
>> Loop Until Now() => Stop0
>>     do something, Yawn!
>> end Loop
>> end Sleep procedure

>> '/* This uses the system clock and a Stop0 variable to tell the Loop
>> when to stop executing.  The Start0 variable is used with the system
>> clock (use a Now/Time function) to define the Stop0 variable.  The "do
>> something, Yawn!" isn't really necessary, just a habit (there's
>> usually code within a Loop structure, but it's not required).  */

>> See your manuals for VBScripting syntax.  I used psuedocode so I
>> wouldn't accidentally handicap you with syntax errors.

>> On Sun, 14 Feb 1999 20:51:45 +0300, "Michael Lopyrev"

>> >You may try to use sleep.exe from NT Reskit. This one example will
>suspent
>> >execution of vbscript to 5 second.

>> >Dim WSHShell
>> >Set WSHShell = CreateObject("WScript.Shell")
>> >WSHShell.Run("cmd /c sleep 5", 0, True)


>> >>Hello,

>> >> I would like to have a built in delay call, as suppose to using a
>> >>counter so I would not slow down the CPU.

>> >>Is there a Sleep, Wait, Delay, or similar command that is not documented
>> >>in VBScript for WSH?

>> >>Thanks

>> >>Youssef


>> Access 97 Programmer/Consultant
>> http://home.att.net/~highlander001


Access 97 Programmer/Consultant
http://home.att.net/~highlander001


Sat, 04 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
Eric:

That's great!

But MS does want us to build ActiveX scripting into our products, right?  So
why not build these capabilities into some "standard" external COM objects
that would be shipped with the ActiveX engines?  You already supply the
"FileSystemObject" and "Scripting.Dictionary" objects, why not some of the
other "typical" functions, like Sleep, #include, etc.

You are doing this for WSH, but what about those of us that embed ActiveX
scripting in our products?

And third-parties need not apply; we have to provide support for our
products, so we pretty much either have to write/support them ourselves or
use the standard MS offerings.


Quote:
>By Popular Demand, I've added a "sleep" command to the next version of WSH,
>which will ship with Windows 2000 and will be available for download on the
>web shortly afterwards.

>Eric



>> You may try to use sleep.exe from NT Reskit. This one example will
suspent
>> execution of vbscript to 5 second.

>> Dim WSHShell
>> Set WSHShell = CreateObject("WScript.Shell")
>> WSHShell.Run("cmd /c sleep 5", 0, True)


>> >Hello,

>> > I would like to have a built in delay call, as suppose to using a
>> >counter so I would not slow down the CPU.

>> >Is there a Sleep, Wait, Delay, or similar command that is not documented
>> >in VBScript for WSH?

>> >Thanks

>> >Youssef



Sat, 04 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
You could write a control that goes to sleep, and then call that control
from VBScript.

Eric


Quote:
> You are absolutely correct.  Now, how would you implement this using
> VScript - the current version, not a beta or upcoming version .)

> On Mon, 15 Feb 1999 17:29:48 -0800, "Eric Lippert (Microsoft Scripting

> >You could, but that would massively slow down anything else running on
your
> >machine -- the CPU spends 100% of its time checking to see if it should
stop
> >running.  A properly implemented sleep command puts the thread into a
wait
> >state, and the operating system knows that it can use the CPU for other
> >tasks while the thread is sleeping.

> >Eric



> >> Couldn't you just use a Loop structure to simulate a Sleep/Delay
> >> function?

> >> psuedocode example:
> >> Sleep procedure (N_Seconds)
> >> Start0 = Now
> >> Stop0 = Start0 + N_Seconds
> >> Loop Until Now() => Stop0
> >>     do something, Yawn!
> >> end Loop
> >> end Sleep procedure

> >> '/* This uses the system clock and a Stop0 variable to tell the Loop
> >> when to stop executing.  The Start0 variable is used with the system
> >> clock (use a Now/Time function) to define the Stop0 variable.  The "do
> >> something, Yawn!" isn't really necessary, just a habit (there's
> >> usually code within a Loop structure, but it's not required).  */

> >> See your manuals for VBScripting syntax.  I used psuedocode so I
> >> wouldn't accidentally handicap you with syntax errors.

> >> On Sun, 14 Feb 1999 20:51:45 +0300, "Michael Lopyrev"

> >> >You may try to use sleep.exe from NT Reskit. This one example will
> >suspent
> >> >execution of vbscript to 5 second.

> >> >Dim WSHShell
> >> >Set WSHShell = CreateObject("WScript.Shell")
> >> >WSHShell.Run("cmd /c sleep 5", 0, True)


> >> >>Hello,

> >> >> I would like to have a built in delay call, as suppose to using a
> >> >>counter so I would not slow down the CPU.

> >> >>Is there a Sleep, Wait, Delay, or similar command that is not
documented
> >> >>in VBScript for WSH?

> >> >>Thanks

> >> >>Youssef


> >> Access 97 Programmer/Consultant
> >> http://home.att.net/~highlander001


> Access 97 Programmer/Consultant
> http://home.att.net/~highlander001



Sat, 04 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
I'm in the business of writing great script compilers and tools -- I'm
trying to get out of the business of writing scriptable COM objects, so that
the script team can spend energy on writing better compilers, not getting
bogged down in the endless details of writing objects.

That said, there are other teams at Microsoft who are working on scriptable
interfaces to commonly used operating system functions.  If you have
suggestions for what would be useful, let me know and I'll pass them along.

Eric


Quote:
> Eric:

> That's great!

> But MS does want us to build ActiveX scripting into our products, right?
So
> why not build these capabilities into some "standard" external COM objects
> that would be shipped with the ActiveX engines?  You already supply the
> "FileSystemObject" and "Scripting.Dictionary" objects, why not some of the
> other "typical" functions, like Sleep, #include, etc.

> You are doing this for WSH, but what about those of us that embed ActiveX
> scripting in our products?

> And third-parties need not apply; we have to provide support for our
> products, so we pretty much either have to write/support them ourselves or
> use the standard MS offerings.


> >By Popular Demand, I've added a "sleep" command to the next version of
WSH,
> >which will ship with Windows 2000 and will be available for download on
the
> >web shortly afterwards.

> >Eric



> >> You may try to use sleep.exe from NT Reskit. This one example will
> suspent
> >> execution of vbscript to 5 second.

> >> Dim WSHShell
> >> Set WSHShell = CreateObject("WScript.Shell")
> >> WSHShell.Run("cmd /c sleep 5", 0, True)


> >> >Hello,

> >> > I would like to have a built in delay call, as suppose to using a
> >> >counter so I would not slow down the CPU.

> >> >Is there a Sleep, Wait, Delay, or similar command that is not
documented
> >> >in VBScript for WSH?

> >> >Thanks

> >> >Youssef



Sat, 04 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
Have a look into my Windows Scripting Host Bazaar. Do to many requests
I decided to publish the WSHExtend.ocx control, which I have developed
for the upcoming WSH book, on my web site. Check out the english part,
click onto the HotZone. I have provided 3 different solutions for
downloading
(with different sizes). The control requires the VB5 libraries, so if you
have
already installed VB 5 or VB 5 CCE, it is sufficient to download the 18 KB
OCX.

The ZIP-Archives comes also with a short HTML file describing the object,
methods and properties of the WSHExt control. Beside the Wait() function
(which is implemented in a way that I suspend the process for a given
interval
without using CPU power) we have a lot of other handy methods requested
from other WSH users: A SendKeys method, a KeyExists method, some
methods to play multimedia files, some methods to access Windows on the
desktop and more.

The whole source code will be released with my book, but I hope the
preliminary
release of the OCX file will be helpful for others.

G. Born

Author of: Windows Scripting Host Tutorial, (see www.wrox.com  in the future
publishing list)

check out also the "Windows Scripting Host Bazaar" in the Hot Zone of my
english web site for further WSH script samples and useful stuff:

http://ourworld.compuserve.com/homepages/Guenter_Born


Quote:
>Hello,

> I would like to have a built in delay call, as suppose to using a
>counter so I would not slow down the CPU.

>Is there a Sleep, Wait, Delay, or similar command that is not documented
>in VBScript for WSH?

>Thanks

>Youssef



Sun, 05 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
Thanks.  And I know I complain endlessly (I am a user after all :-)), but
thanks for making JScript so much better than it originally was!

Now, would you tell me who these teams are and how we can communicate with
them?


Quote:
>I'm in the business of writing great script compilers and tools -- I'm
>trying to get out of the business of writing scriptable COM objects, so
that
>the script team can spend energy on writing better compilers, not getting
>bogged down in the endless details of writing objects.

>That said, there are other teams at Microsoft who are working on scriptable
>interfaces to commonly used operating system functions.  If you have
>suggestions for what would be useful, let me know and I'll pass them along.

>Eric



>> Eric:

>> That's great!

>> But MS does want us to build ActiveX scripting into our products, right?
>So
>> why not build these capabilities into some "standard" external COM
objects
>> that would be shipped with the ActiveX engines?  You already supply the
>> "FileSystemObject" and "Scripting.Dictionary" objects, why not some of
the
>> other "typical" functions, like Sleep, #include, etc.

>> You are doing this for WSH, but what about those of us that embed ActiveX
>> scripting in our products?

>> And third-parties need not apply; we have to provide support for our
>> products, so we pretty much either have to write/support them ourselves
or
>> use the standard MS offerings.


>> >By Popular Demand, I've added a "sleep" command to the next version of
>WSH,
>> >which will ship with Windows 2000 and will be available for download on
>the
>> >web shortly afterwards.

>> >Eric



>> >> You may try to use sleep.exe from NT Reskit. This one example will
>> suspent
>> >> execution of vbscript to 5 second.

>> >> Dim WSHShell
>> >> Set WSHShell = CreateObject("WScript.Shell")
>> >> WSHShell.Run("cmd /c sleep 5", 0, True)


>> >> >Hello,

>> >> > I would like to have a built in delay call, as suppose to using a
>> >> >counter so I would not slow down the CPU.

>> >> >Is there a Sleep, Wait, Delay, or similar command that is not
>documented
>> >> >in VBScript for WSH?

>> >> >Thanks

>> >> >Youssef



Sun, 05 Aug 2001 03:00:00 GMT  
 Is there a Sleep function??
I have been saying for such a long time that the Full Win32/64 Api should be
converted to COM.
It is only to Microsoft advantage. No more worries about DLL HELL changes
just QI for the correct interface
and VOILA!!!!!!!!!


Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 21 post ]  Go to page: [1] [2]

 Relevant Pages 

1. sleep function

2. I need simulate sleep() C function

3. Sleep function in vbscript????

4. sleep function

5. Sleep function

6. Sleep Function & FileSystemObject

7. ASP sleep function

8. sleep function

9. sleep function

10. Sleep function to run in vbscript?

11. What Function am I in?

12. What Function/Sub am I in.

 

 
Powered by phpBB® Forum Software