summaryrefslogtreecommitdiff
path: root/NET/worlds/network/Timer.java
blob: cf0820416cebd8e7601db5f3e69cbd5191a05f69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package NET.worlds.network;

import NET.worlds.core.Std;

public class Timer {
   int _startTime;
   String _msg;

   public Timer(String msg) {
      this._msg = msg;
      this._startTime = Std.getRealTime();
   }

   public void stop(int minDur) {
      int endTime = Std.getRealTime();
      int duration = endTime - this._startTime;
      if (duration > minDur) {
         System.out.println(this._msg + ": " + duration + "ms");
      }
   }
}