// 2006.11.06 most minimal template integer test1(integer k, string s) { list x; integer i; integer f0 = llGetFreeMemory(); for(i = 0; i < k; i++) { x += [s]; // llOwnerSay((string)i+": "+(string)llGetFreeMemory()); } integer f1 = llGetFreeMemory(); float bytesEach = (((float)(f0-f1)) / (float)k); llOwnerSay((string)k + " \"" + s + "\"s took " + (string)bytesEach + " bytes each"); return (integer)bytesEach; } float gTouchStartTime = 0; default { on_rez(integer n) { } state_entry() { llSetText("Click to run list memory test\n" + (string)llGetFreeMemory() + " bytes free.",<.2,0,1>,1); } touch_start(integer total_number) { llSetText("\n\n______\n\n",<1,.5,0>,1); gTouchStartTime = llGetTime(); } touch(integer total_number) { float touchEndTime = llGetTime(); if((touchEndTime - gTouchStartTime) > 2) { llSetText("Resetting Test Device",<1,0,0>,1); llSleep(1); llResetScript(); } } touch_end(integer total_number) { if(gTouchStartTime) // will be zero if the touch was from before reset { llSetText("\n\nRunning\n\n",<1,.5,0>,1); llSay(0,(string)llGetFreeMemory() + " bytes free."); test1(10,"."); test1(10,"fish"); test1(100,"."); test1(100,"fish"); llSay(0,(string)llGetFreeMemory() + " bytes free."); llSetText((string)llGetFreeMemory() + " bytes free.\nClick and hold to reset.",<0,.5,0>,1); } } listen(integer channel,string name,key id,string message) { } timer() { } } // end of file