File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ public class Server {
140
140
141
141
private float maxUse = 0 ;
142
142
private float tickUsage ;
143
+ private long tickUseNano ;
143
144
144
145
private int sendUsageTicker = 0 ;
145
146
@@ -1257,7 +1258,8 @@ private boolean tick() {
1257
1258
//float use = Math.min(1, (now - tickTime) / 50);
1258
1259
1259
1260
float tick = (float ) Math .min (20 , 1000000000 / Math .max (1000000 , ((double ) nowNano - tickTimeNano )));
1260
- float use = (float ) Math .min (1 , ((double ) (nowNano - tickTimeNano )) / 50000000 );
1261
+ this .tickUseNano = nowNano - tickTimeNano ; // record the tick time in nano seconds
1262
+ float use = (float ) Math .min (1 , ((double ) tickUseNano ) / 50000000 );
1261
1263
1262
1264
if (this .maxTick > tick ) {
1263
1265
this .maxTick = tick ;
@@ -1577,6 +1579,10 @@ public float getTickUsageAverage() {
1577
1579
return tickUsageAverage ;
1578
1580
}
1579
1581
1582
+ public long getTickUseNano () {
1583
+ return tickUseNano ;
1584
+ }
1585
+
1580
1586
private static float getAverage (float [] array ) {
1581
1587
float sum = 0 ;
1582
1588
int count = array .length ;
You can’t perform that action at this time.
0 commit comments