Page 1 of 1 1
Topic Options
#74837 - 2003-05-06 07:37 PM Call Statement
qboyd00 Offline
Fresh Scripter

Registered: 2002-04-25
Posts: 15
Does any one know how long it takes (ms) for a call statement to complete?
Top
#74838 - 2003-05-06 08:12 PM Re: Call Statement
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
it depends in a few things. speed of the network connection between the computer and the resource housing the called script. But the major issue in the speed of a called script is the called script it self.

What is the called script doing?

Can you run the called script by it self? If so, how long does it take to run?

in theory, it should take the same amount of time to run a called script as it takes to run a script from a command line.

Bryce

Top
#74839 - 2003-05-06 08:33 PM Re: Call Statement
qboyd00 Offline
Fresh Scripter

Registered: 2002-04-25
Posts: 15
For example: I have multiple call statements that are calling one liner scripts and I was thinking about consolidating them into one utility.kix script and was curious of how much time I would save eliminating multiple call statements.
Top
#74840 - 2003-05-06 09:00 PM Re: Call Statement
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Possible that our kixstrip tool can help you, which you can
find on our site.

Example what do you see by using the "/Debug" option

Steps:
[list=1]
[*]we have two scripts. second one will be called by first one.
script1.kix
code:
? "script 1 - kix "+@kix $nul=RedirectOutput("")
call "d:\script2.kix"
sleep 1
call "d:\script2.kix"
? "script 1 - completed."

script2.kix
code:
? "script 2 - kix "+@kix $nul=RedirectOutput("")

[*]we add required debugging code to both scripts with the
call:
kixstrip script1 script1.kix /Debug

The result for first script is:
code:
            ;CLS
IF (instr("-3.0x-3.1x-3.2x-3.3x-","-"+substr(@kix,1,3)+"x-") <> 0)
IF MessageBox("sorry, your kixtart "+@kix+" release is too old."+CHR(13)+CHR(10)+CHR(13)+CHR(10)+" please upgrade.","KiXtart "+@kix+" info",4112,300)
ENDIF
EXIT
ENDIF
COLOR C+/N
;AT (1,1) " "

$_debug_file="kixdebug.txt" ; - %tmp% directory -
IF (len($_debug_file) <> 0)
IF (substr("%tmp%",len("%tmp%"),1) = "\")
$_debug_file="%tmp%"+$_debug_file
ELSE
$_debug_file="%tmp%\"+$_debug_file
ENDIF
ENDIF
;$_debug_file="c:\kixdebug.txt"
IF RedirectOutput($_debug_file)
ENDIF

? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.18e script starting"
IF (Val(substr(@kix,1,1)) >= 4)
IF (len(@scriptname) <> 0)
" ("+LCASE(@scriptname)+")"
ENDIF
ENDIF
? "-"
IF ("$_debug_already_starting" <> "yes")
? "-curdir: "+LCASE(@curdir)
? "-scriptdir: "+LCASE(@scriptdir)
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-scriptname: "+LCASE(@scriptname)
ENDIF
? "-startdir: "+LCASE(@startdir)
? "-"
? "-userid: "+LCASE(@userid)+"/"+LCASE(@wuserid)
? "-user priv: "+LCASE(@priv)
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
? "-version: inwin="+@inwin+"/dos="+@dos"/productsuite="+@productsuite+"/producttype="+@producttype"/csd="+LTRIM(RTRIM(@csd))
ELSE
? "-version: inwin="+@inwin+"/dos="+@dos
ENDIF
? "-"
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-"+@cpu+" (memory "+MemorySize()+" MB)"
? "-"
ENDIF
ENDIF

$_debug_temp_name="" ; -format: yyyymmdd_hhmmss.sss_999 scriptname-
IF (instr("-3.6x-","-"+substr(@kix,1,3)+"x-") <> 0) OR (Val(substr(@kix,1,1)) >= 4)
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
$_debug_temp_name=@msecs
SELECT
CASE (len($_debug_temp_name) = 1)
$_debug_temp_name="00"+$_debug_temp_name
CASE (len($_debug_temp_name) = 2)
$_debug_temp_name="0"+$_debug_temp_name
ENDSELECT
$_debug_temp_name="."+$_debug_temp_name
IF Srnd(@msecs)
ENDIF
SLEEP 0.050
ELSE
IF Srnd((-1)*32767/(substr(@time,7,2)+1))
ENDIF
SLEEP 1
ENDIF
$_debug_temp_name=substr(@date,1,4)+substr(@date,6,2)+substr(@date,9,2)+"_"+substr(@time,1,2)+substr(@time,4,2)+substr(@time,7,2)+$_debug_temp_name+"_"+Rnd()
IF (len($_debug_temp_name) < 25)
$_debug_temp_name=substr($_debug_temp_name+" ",1,25)
ENDIF
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
IF (len(@scriptname) < 12)
$_debug_temp_name=$_debug_temp_name+" "+substr(@scriptname+" ",1,12)
ELSE
$_debug_temp_name=$_debug_temp_name+" "+@scriptname
ENDIF
ENDIF
ENDIF

IF ("$_debug_already_starting" <> "yes")
? "-debug file: "+$_debug_file
? "-debug name: "+LCASE($_debug_temp_name)
ELSE
IF (len($_debug_temp_name) <> 0)
? "-debug: "+LTRIM(RTRIM(LCASE($_debug_temp_name)))+" -> "+$_debug_file
ELSE
? "-debug-file: "+$_debug_file
ENDIF
ENDIF

IF (instr("-3.6x-","-"+substr(@kix,1,3)+"x-") = 0) AND (Val(substr(@kix,1,1)) < 4)
GOTO _debug_starting_point
ENDIF
DIM $_debug_name ; -create local variable-
:_debug_starting_point
$_debug_name=LCASE($_debug_temp_name)
$_debug_already_starting="yes"
? "-"
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?

?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? ? "script 1 - kix "+@kix $nul=RedirectOutput("") IF RedirectOutput($_debug_file) ENDIF ; -inserted by kixstrip-
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? CALL "d:\script2.kix"
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? SLEEP 1
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? CALL "d:\script2.kix"
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? ? "script 1 - completed."

?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"
? "-"
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.18e script ending"
IF (Val(substr(@kix,1,1)) >= 4)
IF (len(@scriptname) <> 0)
" ("+LCASE(@scriptname)+")"
ENDIF
ENDIF
? "-"
IF RedirectOutput("CON")
ENDIF
COLOR C+/N
?
? "Informative KIX "+@kix+":"+" debug info see "+CHR(34)+$_debug_file+CHR(34)
IF (Val(substr(@kix,1,1)) >= 4)
IF (len(@scriptname) <> 0)
" ("+LCASE(@scriptname)+")"
ENDIF
ENDIF
IF RedirectOutput($_debug_file)
ENDIF
;($begin)
;
; fri 12-jul-2002 09:10:29 (kix 4.10 vs 3.18e)
;
;Informative KIXSTRIP: no errors found (input=5 output=5 skip=0).
;
;Informative KIXSTRIP: no block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 2 CALL
;Informative KIXSTRIP: 1 SLEEP
;
;($end)

[*]without any correction we run first script.
The results can be
code:
-friday 2002/07/12 04:13:12- kixtart 3.47/3.18e script starting
-
-curdir: d:\kixtart\kix347
-scriptdir:
-startdir: d:\kixtart\kix347\
-
-userid: -/-
-user priv: guest
-version: inwin=2/dos=4.90
-
-debug file: c:\temp\kixdebug.txt
-debug name:
-
----- start-04:13:12-- 0 The operation completed successfully.

- 1-04:13:12-- 0 The operation completed successfully.

script 1 - kix 3.47
- 2-04:13:12-- 0 The operation completed successfully.

-friday 2002/07/12 04:13:12- kixtart 3.47/3.18e script starting
-
-debug-file: c:\temp\kixdebug.txt
-
----- start-04:13:12-- 0 The operation completed successfully.

- 1-04:13:12-- 0 The operation completed successfully.

script 2 - kix 3.47
- 2-04:13:12-- 0 The operation completed successfully.

------- end-04:13:12-- 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:12- kixtart 3.47/3.18e script ending
-
- 3-04:13:12-- 0 The operation completed successfully.

- 4-04:13:13-- 0 The operation completed successfully.

-friday 2002/07/12 04:13:13- kixtart 3.47/3.18e script starting
-
-debug-file: c:\temp\kixdebug.txt
-
----- start-04:13:13-- 0 The operation completed successfully.

- 1-04:13:13-- 0 The operation completed successfully.

script 2 - kix 3.47
- 2-04:13:13-- 0 The operation completed successfully.

------- end-04:13:13-- 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:13- kixtart 3.47/3.18e script ending
-
- 5-04:13:13-- 0 The operation completed successfully.

script 1 - completed.
------- end-04:13:13-- 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:13- kixtart 3.47/3.18e script ending
-

for KiXtart 4.10 the result is:
code:
-friday 2002/07/12 04:13:40- kixtart 4.10/3.18e script starting (script1.kix)
-
-curdir: d:\
-scriptdir: d:
-scriptname: script1.kix
-startdir: d:
-
-userid: -/-
-user priv: guest
-version: inwin=2/dos=4.90/productsuite=/producttype=Windows Me/csd=
-
-Intel Pentium III (memory 511 MB)
-
-debug file: c:\temp\kixdebug.txt
-debug name: 20020712_041340.620_2063 script1.kix
-
----- start-04:13:40-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

- 1-04:13:40-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

script 1 - kix 4.10
- 2-04:13:40-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

-friday 2002/07/12 04:13:40- kixtart 4.10/3.18e script starting (script2.kix)
-
-debug: 20020712_041340.730_2422 script2.kix -> c:\temp\kixdebug.txt
-
----- start-04:13:40-20020712_041340.730_2422 script2.kix - 0 The operation completed successfully.

- 1-04:13:40-20020712_041340.730_2422 script2.kix - 0 The operation completed successfully.

script 2 - kix 4.10
- 2-04:13:40-20020712_041340.730_2422 script2.kix - 0 The operation completed successfully.

------- end-04:13:40-20020712_041340.730_2422 script2.kix - 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:40- kixtart 4.10/3.18e script ending (script2.kix)
-
- 3-04:13:40-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

- 4-04:13:41-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

-friday 2002/07/12 04:13:41- kixtart 4.10/3.18e script starting (script2.kix)
-
-debug: 20020712_041341.770_2553 script2.kix -> c:\temp\kixdebug.txt
-
----- start-04:13:41-20020712_041341.770_2553 script2.kix - 0 The operation completed successfully.

- 1-04:13:41-20020712_041341.770_2553 script2.kix - 0 The operation completed successfully.

script 2 - kix 4.10
- 2-04:13:41-20020712_041341.770_2553 script2.kix - 0 The operation completed successfully.

------- end-04:13:41-20020712_041341.770_2553 script2.kix - 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:41- kixtart 4.10/3.18e script ending (script2.kix)
-
- 5-04:13:41-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.

script 1 - completed.
------- end-04:13:41-20020712_041340.620_2063 script1.kix - 0 The operation completed successfully.
-
-friday 2002/07/12 04:13:41- kixtart 4.10/3.18e script ending (script1.kix)
-

any comment or suggestion is welcome.
greetings.

btw: symbol  - on our pages has been linked to related http://kixtart.org topic.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#74841 - 2003-05-06 09:32 PM Re: Call Statement
qboyd00 Offline
Fresh Scripter

Registered: 2002-04-25
Posts: 15
????????? [Confused]
Top
#74842 - 2003-05-06 09:43 PM Re: Call Statement
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol!
just print out the time before the call and after.

that is the easy way to know what the time consumption is.
_________________________
!

download KiXnet

Top
#74843 - 2003-05-06 09:46 PM Re: Call Statement
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
For each CALL you will probably save "about"
less then 1 sec.

In general I would bet that having them all in one file as FUNCTIONS would be better.

Please let us know what version of KiXtart you use and maybe post the main code and examples of the CALL code and we can help you further.

Top
#74844 - 2003-05-06 11:54 PM Re: Call Statement
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
To expand on Lonkero's response..

You can try the DeltaTime() UDF

It would be something like -
code:
$start = @time + ':' + @msecs
CALL @SCRIPTDIR+'\YOURSCRIPT.KIX'
$end = @time + ':' + @msecs
? 'Start time : $start' ?
? 'End time : $end' ?
$Duration = DeltaTime($start,$end)
? 'Duration : $Duration' ? ?

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 867 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.136 seconds in which 0.11 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