private static final int NUM_TRIALS = 5;
private static final int NUM_REPS = 10000;
protected void benchmark() throws Exception {
for (int trial = 0; trial < NUM_TRIALS; trial++) {
TSerializer ser = new TSerializer(getFactory());
byte[] serialized = null;
long serStart = System.currentTimeMillis();
for (int rep = 0; rep < NUM_REPS; rep++) {
serialized = ser.serialize(Fixtures.holyMoley);
}
long serEnd = System.currentTimeMillis();
long serElapsed = serEnd - serStart;
System.out.println("Ser:\t" + serElapsed + "ms\t"
+ ((double)serElapsed / NUM_REPS) + "ms per serialization");