After I got multiple automated tells in some of the Fantasy Faire shopping zones that my scripts were causing lag with a running time of over 0.2 ms, I tried testing them myself. None of the existing script load measuring objects I knew about in-world report time load, so I looked up some code samples and threw this together:
default
{
touch_start(integer total_number)
{
list AttachedUUIDs = llGetAttachedList(llGetOwner());
integer i = 0;
float total = 0.0;
while (i < llGetListLength(AttachedUUIDs) )
{
list temp = llGetObjectDetails(llList2Key(AttachedUUIDs, i), [OBJECT_SCRIPT_TIME]);
total += 1000.0 * llList2Float(temp, 1);
++i;
}
llOwnerSay("total ms: " + (string)total);
}
}
Right after I zoned into a Faire sim it reported 0.11 ms, but since then it's bounced between 0.045 and 0.065.
Now, the docs do say this is average over the last 30 seconds or however long I've been in the zone, whichever is less. They also say it excludes HUD attachments (because llGetAttachedList() doesn't include those and I don't see another LSL function to fetch them), so I don't know if I'm measuring the same thing, but I don't know how I was getting measured as causing so much load. Can anyone help me out?