|
|
|||||||
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. |
||||||||
|
|
|||||||
What is the problem with SLEEP? It is well documented in the KiXtart Manual! quote: [ 03. December 2002, 18:48: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
heh, good to know that I'm answer for any sleep related questions... well, at least board seems to think so |
||||||||
|
|
|||||||
Hello ElegantSol and Welcome to the board. Here is an example of using SLEEP code: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.IF EXIST("%windir%\DESKTOP\SAP*.LNK") DEL ("%windir%\DESKTOP\SAP*.LNK") ENDIF |
||||||||
|
|
|||||||
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 ] |
||||||||
|
|
|||||||
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: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.use r: '\\server\share' There are not many uses for SLEEP. The main use in within LOOPs to decrease CPU stress. |
||||||||
|
|
|||||||
Also ! One can use 'sleep 0.001' in excessive loops in order to prevent CPU stress ... |