*
* @param args the arguments
* @throws InterruptedException the interrupted exception
*/
public static void main(String[] args) throws InterruptedException {
final Stopwatch stopwatch = Audits.getBasicStopwatch(BASIC_STOPWATCH_ID);
stopwatch.setShouldReset(false);
stopwatch.setRemovalListener(new AuditRemovalListener() {
public void onRemoval(AuditEvent auditEvent) {
System.out.println(auditEvent);
}
});
Audits.unmapAudit(stopwatch);
new Thread(new Runnable() {
public void run() {
while (true) {
stopwatch.start();
try {
Thread.sleep((long) (Math.random() * 100));
} catch (InterruptedException e) {
e.printStackTrace();
}
stopwatch.stop();
}
}
}).start();
for (int i=0;i<10;i++) {
new Thread(new Runnable() {
public void run() {
while (true) {
CountingStopwatch stopwatch = Audits.getCountingStopwatch(COUNTING_STOPWATCH_ID);
stopwatch.start();
try {
Thread.sleep((long) (Math.random() * 100));
} catch (InterruptedException e) {
e.printStackTrace();
}
stopwatch.stop(23);
}
}
}).start();
}
new Thread(new Runnable() {