/**
* @param args
*/
public static void main(String[] args) {
final ConcurrentCircleArray cca = new ConcurrentCircleArray(200);
Thread t1 = new Thread(){
public void run() {
for (int i = 0; i < 10000; i ++) {
cca.add(10);
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
};
t1.start();
Thread t2 = new Thread(){
public void run() {
for (int i = 0; i < 10000; i ++) {
System.out.println("avg1="+cca.getQpsAndAvg()[0]);
System.out.println("qps1="+cca.getQpsAndAvg()[1]);
System.out.println("avg2="+cca.getArrayAvg());
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();