diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/StatRateNode.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/console/StatRateNode.java')
| -rw-r--r-- | NET/worlds/console/StatRateNode.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/NET/worlds/console/StatRateNode.java b/NET/worlds/console/StatRateNode.java new file mode 100644 index 0000000..e1a74a1 --- /dev/null +++ b/NET/worlds/console/StatRateNode.java @@ -0,0 +1,90 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import NET.worlds.core.Std; +/* */ import java.awt.List; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class StatRateNode +/* */ extends StatMan +/* */ implements MainCallback +/* */ { +/* 17 */ private static StatRateNode _singleInstance = new StatRateNode(); +/* */ private int _lastTime; +/* */ +/* 20 */ public static StatRateNode getNode() { return _singleInstance; } +/* */ +/* */ private StatRateNode() +/* */ { +/* 24 */ StatisticsRoot.getNode().addChild(this); +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 29 */ return "Active Threads"; +/* */ } +/* */ +/* */ +/* */ private static final int TITLE = 0; +/* */ synchronized void grabList(List list) +/* */ { +/* 36 */ super.grabList(list); +/* 37 */ Main.register(this); +/* */ } +/* */ +/* */ +/* */ synchronized void releaseList(boolean terminalCallback) +/* */ { +/* 43 */ if (!terminalCallback) { +/* 44 */ Main.unregister(this); +/* */ } +/* 46 */ super.releaseList(terminalCallback); +/* */ } +/* */ +/* */ +/* */ public synchronized void mainCallback() +/* */ { +/* 52 */ int thisTime = Std.getFastTime(); +/* 53 */ if (thisTime - this._lastTime > 1000) { +/* 54 */ updateList(); +/* 55 */ this._lastTime = thisTime; +/* */ } +/* */ } +/* */ +/* */ +/* */ private static final int BLANK1 = 1; +/* */ +/* */ private static final int THREADS = 2; +/* */ +/* */ private int lastQueueLength; +/* */ void createList() +/* */ { +/* 67 */ this._grabbedList.add("Active Thread Statistics", 0); +/* 68 */ this._grabbedList.add("", 1); +/* */ +/* 70 */ this.lastQueueLength = Main.queueLength(); +/* */ +/* 72 */ this._grabbedList +/* 73 */ .add("Number main threads: " + this.lastQueueLength, 2); +/* */ } +/* */ +/* */ void updateList() +/* */ { +/* 78 */ if (Main.queueLength() != this.lastQueueLength) { +/* 79 */ this.lastQueueLength = Main.queueLength(); +/* 80 */ this._grabbedList.replaceItem("Number main threads: " + this.lastQueueLength, +/* 81 */ 2); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\StatRateNode.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |