Page 1 of 1 1
Topic Options
#33977 - 2002-12-03 06:39 PM SLEEP USAGE ADVICE
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
I was trying to do a search to get more info on the usage, need for and time values for the SLEEP command.

Unfortunatly, I mostly get Lonkero's signature instead of the boards message text.

Signatures should be excluded from the search.
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#33978 - 2002-12-03 06:41 PM Re: SLEEP USAGE ADVICE
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
What is the problem with SLEEP? It is well documented in the KiXtart Manual!
quote:
Action: Halts script execution for the number of seconds specified.

Syntax: SLEEP <seconds>



[ 03. December 2002, 18:48: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#33979 - 2002-12-03 06:47 PM Re: SLEEP USAGE ADVICE
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Welcome to the board. The functionality of the search tool is under the control of the UBB software authors so those sort of suggestions would be better directed to www.infopop.com instead. As Jens said, SLEEP is a pretty simple command and not likely to be used in creative ways.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#33980 - 2002-12-03 07:14 PM Re: SLEEP USAGE ADVICE
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22335
Loc: OK
heh, good to know that I'm answer for any sleep related questions...
well, at least board seems to think so [Big Grin]
_________________________
!

download KiXnet

Top
#33981 - 2002-12-03 09:29 PM Re: SLEEP USAGE ADVICE
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11571
Loc: CA
Hello ElegantSol and Welcome to the board.

Here is an example of using SLEEP

code:
IF EXIST("%windir%\DESKTOP\SAP*.LNK") DEL ("%windir%\DESKTOP\SAP*.LNK") ENDIF
SLEEP 2

This would cause the script to pause execution for 2 seconds before continuing with the rest of the script. You could also use .2 .5 .9 etc... to have it pause for 2/10th of a second etc.

Top
#33982 - 2002-12-04 01:21 PM Re: SLEEP USAGE ADVICE
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
Yes, the syntax of SLEEP is obvious, especially in the case of delaying the script to allow the user to read the screen output. What is not obvious is its usage in other places. I have looked at numerous scripts on the boards and seen it in places other than text display. It appears it is being used to allow a prior command to complete.

If command completion is the reason, then which commands require a delay and how does one determine the proper amount of time to allow, other than trial and error.

[ 04. December 2002, 14:31: Message edited by: ElegantSol ]
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#33983 - 2002-12-04 04:24 PM Re: SLEEP USAGE ADVICE
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Most of the time you see the sLEEP command in othe rpeoples code it's actually a non-necessary line of code inserted by mostly inexperienced KiXtart coders.
code:
use r: '\\server\share'
sleep5

for example doesn't do anything except delaying the script execution by 5 seconds. KiXtart is a sequential language, thus a command is only executed after the previous one finished. In this case SLEEP is unnecessary.

There are not many uses for SLEEP. The main use in within LOOPs to decrease CPU stress.
_________________________
There are two types of vessels, submarines and targets.

Top
#33984 - 2002-12-04 04:51 PM Re: SLEEP USAGE ADVICE
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6373
Loc: Stuttgart, Germany
Also !

One can use 'sleep 0.001' in excessive loops in order to prevent CPU stress ...
_________________________



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 176 anonymous users online.
Newest Members
diefnet, Arogya, gkustra, emnipetro, Hirze
17644 Registered Users

Generated in 0.031 seconds in which 0.01 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org