Difference between revisions of "Say Region Frames Per Second"
Jump to navigation
Jump to search
m (Say Region Rames Per Second moved to Say Region Frames Per Second) |
m (<lsl> tag to <source>) |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
<source lang="lsl2"> | |||
default | 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); | |||
} | } | ||
} | } | ||
</source> | |||
{{LSLC|Examples}} | |||
{{LSLC|Library}} |
Latest revision as of 16:51, 24 January 2015
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);
}
}