Page 1 of 1 1
Topic Options
#134749 - 2005-03-01 05:41 AM Script Performance Timings
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Trying to get the following to work..

Requires:
LOGGER()
TIMEDIFF()
SERIALTIME()

Code:

cls
break on
TIMERTEST(@ldrive+'newscript\kixtart.kix')
?'Process is complete.. Press a key'
get $
FUNCTION TIMERTEST($script)
$logfile='C:\Timer.txt'
$starttime=@time
LOGGER($logfile,$starttime+@crlf)
CALL $script
$endtime=@time
LOGGER($logfile,$endtime+@crlf)
$rc=TIMEDIFF($starttime,$endtime)
LOGGER($logfile,$rc+@crlf)
ENDFUNCTION



Thanks,

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

Top
#134750 - 2005-03-01 09:09 AM Re: Script Performance Timings
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Like Yoda said:
Quote:

"Try not; do or do not. There is no try!"





Kidding... What isn't working?
Using
Code:
Break on
CLS
Sleep 5
Exit (0)



gives me:

08:53:25
08:53:30
00:00:05.000


Looks allright to me...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#134751 - 2005-03-01 10:29 AM Re: Script Performance Timings
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Kent,

Unlikely you're going to be running a script overnight or through the midnight period for testing. If so then yeah you might need the other math UDFs for timing.

Here is a much smaller method that lets you put all the logging outside of your UDF.

Code:
Break On
Dim $SO,$Pause
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')

Dim $CheckScript
$CheckScript = TimerTest(@LDRIVE+'newscript\kixtart.kix')
? 'Start Time: ' + $CheckScript[0]
? 'End Time: ' + $CheckScript[1]
? 'Elapsed Time: ' + $CheckScript[2]
COLOR 'R/W'
?? 'Process is complete.. Press a key' ?
Get $Pause

Function TimerTest($Script)
Dim $StartTime,$EndTime,$ElapsedTime
$StartTime=@TICKS
CALL $Script
$EndTime=@TICKS
$ElapsedTime=FormatNumber($EndTime-$StartTime,0,0,-1,-2)
$TimerTest=$StartTime,$EndTime,$ElapsedTime
EndFunction



Example script timing:
Start Time: 23381046
End Time: 23387328
Elapsed Time: 6,282

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 927 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.089 seconds in which 0.064 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