Say Region Frames Per Second

From Second Life Wiki
Revision as of 16:51, 24 January 2015 by ObviousAltIsObvious Resident (talk | contribs) (<lsl> tag to <source>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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);
    }
}