Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Lag Meter Lag_meter  

Lag_meter

The script

Category: Lag Meter
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Lag_meter
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Lag_meter_1.lsl
1 float lag;
2 string lagStr;
3 integer decimalsAccuracy = 3;
4
5 string percentageLag()
6 {
7 lag = 1 - llGetRegionTimeDilation();
8 lag *= 100;
9 lagStr = (string)lag;
10 list cheat = llParseString2List(lagStr, ["."], []);
11 lagStr = llList2String(cheat, 0);
12 string decimals = llGetSubString(llList2String(cheat, 1), 0, decimalsAccuracy - 1);
13 string text = lagStr+"."+decimals+"%";
14 return text;
15 }
16
17 string getFPS()
18 {
19 float fps = llGetRegionFPS();
20 string str = (string)fps;
21 list cheat = llParseString2List(str, ["."], []);
22 str = llList2String(cheat, 0);
23 string decimals = llGetSubString(llList2String(cheat, 1), 0, 1);
24 string text = str+"."+decimals;
25 return text;
26 }
27
28 default
29 {
31 {
32 llSetTimerEvent(.05);
33 llListen(0, "", "", "");
34 }
35
36 listen(integer c, string n, key id, string msg)
37 {
38 if(msg == "report")
39 {
40 llSay(0, " -- "+llGetRegionName()+" --");
41 llSay(0, "Frames Per Second: "+getFPS());
42 llSay(0, "The sim lag is currently "+percentageLag()+"..");
43 }
44 if(msg == "lagtrace.on") llSetTimerEvent(.2);
45 if(msg == "lagtrace.off")
46 {
48 llSetText("", <0,0,0>, 0.0);
49 }
50 }
51
52 timer()
53 {
54 llSetText("Lag: "+percentageLag(), <1,.5,.5>, 1.0);
55 }
56 }

Back to the Best Free Tools in Second Life and OpenSim.