Difference between revisions of "Say Region Frames Per Second"
Jump to navigation
Jump to search
m (lsl code tagging) |
Kireji Haiku (talk | contribs) m (removed unnecessary listen from example script and changed to touch_start) |
||
Line 2: | Line 2: | ||
default | default | ||
{ | { | ||
touch_start(integer num_detected) | |||
{ | { | ||
float fps = llGetRegionFPS(); | float fps = llGetRegionFPS(); | ||
string region = llGetRegionName(); | string region = llGetRegionName(); | ||
llSay( | |||
if(fps | // PUBLIC_CHANNEL has the integer value 0 | ||
llSay(PUBLIC_CHANNEL, | |||
llSay( | "Region '" + region + "' is running at " + (string)fps + " fps."); | ||
else if(fps | if (27.0 < fps) | ||
llSay(PUBLIC_CHANNEL, | |||
llSay( | "'" + region + "' is running smoothly."); | ||
else if (15.0 < fps) | |||
llSay(PUBLIC_CHANNEL, | |||
"'" + region + "' is running slowly."); | |||
else | else | ||
llSay(PUBLIC_CHANNEL, | |||
llSay( | "CAUTION: '" + region + "' is in danger of crashing."); | ||
} | } | ||
} | } |
Revision as of 13:48, 7 October 2012
<lsl> default {
touch_start(integer num_detected) { float fps = llGetRegionFPS(); string region = llGetRegionName();
// PUBLIC_CHANNEL has the integer value 0 llSay(PUBLIC_CHANNEL, "Region '" + region + "' is running at " + (string)fps + " fps.");
if (27.0 < fps) llSay(PUBLIC_CHANNEL, "'" + region + "' is running smoothly.");
else if (15.0 < fps) llSay(PUBLIC_CHANNEL, "'" + region + "' is running slowly.");
else llSay(PUBLIC_CHANNEL, "CAUTION: '" + region + "' is in danger of crashing."); }
} </lsl>