Say Region Frames Per Second

From Second Life Wiki
Revision as of 13:19, 10 June 2014 by Omei Qunhua (talk | contribs) (SLuniverse vote)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

<lsl> default {

   touch_start(integer num_detected)
   {
       float fps = llGetRegionFPS();
       string region = llGetRegionName();
       llSay(0, "Region '" + region + "' is running at " + (string)fps + " fps.");
       string moreInfo = "CAUTION: '" + region + "' is in danger of crashing.";
       if (fps > 15)
           moreInfo = "'" + region + "' is running slowly.");
       if (fps > 27)
           moreInfo = "'" + region + "' is running smoothly.");
       llSay(0, moreInfo);
   }

} </lsl>