Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Testing the speed (timing) of a script

Montecore Babcock
Registered User
Join date: 20 May 2006
Posts: 48
08-24-2009 15:50
I had a link to it but lost it and I've been trying to find it since in the labrynith of SL pages on scripting. Basically I want to calculate how long part of my script takes to execute. And then out put it to a list or something where I can view it later. Sorry, I know this is probably a fairly well know thing but I just can't find it right now.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-24-2009 16:24
Just put llOwnerSay((string)llGetTime() ) at the start and end of sections you need to time. If you want to dump to a list, then. .....

CODE

list time = [];
default
{
//stuff
time += "Step 1: " + llGetTime();
// More stuff
time += "Step 2: + llGetTime();
//And so forth
integer len = llGetListLength(time);
integer i;
for (i=0;i<=len-1;i++)
{
llOwnerSay(llList2String(time,i));
}
}
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-25-2009 15:28
for more definitive testing of code segments...
https://wiki.secondlife.com/wiki/LSL_Script_Efficiency#How_Fast_Does_That_Code_Run
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -