feud.clientserver
Class PerformanceCounter

java.lang.Object
  extended byfeud.clientserver.PerformanceCounter

public class PerformanceCounter
extends java.lang.Object

A simple class used by both, the client and the server, to measure bandwidth usage.


Constructor Summary
PerformanceCounter(java.lang.String label)
          Creates a new counter.
 
Method Summary
 void in(int cnt)
          Adds a number of bytes to the in-counter.
 void out(int cnt)
          Adds a number of bytes to the out-counter.
 void printStats()
          Prints the stats if more than 10 seconds have elapsed since the last printing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerformanceCounter

public PerformanceCounter(java.lang.String label)
Creates a new counter. The counter has label that is used in the printStats-method...the label can be anything you like.

Parameters:
label - the label
Method Detail

printStats

public void printStats()
Prints the stats if more than 10 seconds have elapsed since the last printing.


in

public void in(int cnt)
Adds a number of bytes to the in-counter.

Parameters:
cnt - the number

out

public void out(int cnt)
Adds a number of bytes to the out-counter.

Parameters:
cnt - the number