}
}
public void testTime() {
Receipt info = (Receipt) createPacket();
ReceiptWriter writer = new ReceiptWriter();
ReceiptReader reader = new ReceiptReader();
try {
int count = 100000;
long startTime = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
byte[] data = writer.writePacketToByteArray(info);
Receipt test = (Receipt) reader.readPacketFromByteArray(data);
}
long finishTime = System.currentTimeMillis();
long totalTime = finishTime - startTime;
long ps = (count * 1000) / totalTime;
System.out.println("Time taken :" + totalTime + " for " + count + "iterations, = " + ps + " per sec.");