Reformat all files in the project according to java conventions.
This commit is contained in:
@@ -10,29 +10,29 @@ public class SafeEncoderBenchmark {
|
||||
private static final int TOTAL_OPERATIONS = 10000000;
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException,
|
||||
IOException {
|
||||
long begin = Calendar.getInstance().getTimeInMillis();
|
||||
IOException {
|
||||
long begin = Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
|
||||
SafeEncoder.encode("foo bar!");
|
||||
}
|
||||
for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
|
||||
SafeEncoder.encode("foo bar!");
|
||||
}
|
||||
|
||||
long elapsed = Calendar.getInstance().getTimeInMillis() - begin;
|
||||
long elapsed = Calendar.getInstance().getTimeInMillis() - begin;
|
||||
|
||||
System.out.println(((1000 * TOTAL_OPERATIONS) / elapsed)
|
||||
+ " ops to build byte[]");
|
||||
System.out.println(((1000 * TOTAL_OPERATIONS) / elapsed)
|
||||
+ " ops to build byte[]");
|
||||
|
||||
begin = Calendar.getInstance().getTimeInMillis();
|
||||
begin = Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
byte[] bytes = "foo bar!".getBytes();
|
||||
for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
|
||||
SafeEncoder.encode(bytes);
|
||||
}
|
||||
byte[] bytes = "foo bar!".getBytes();
|
||||
for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
|
||||
SafeEncoder.encode(bytes);
|
||||
}
|
||||
|
||||
elapsed = Calendar.getInstance().getTimeInMillis() - begin;
|
||||
elapsed = Calendar.getInstance().getTimeInMillis() - begin;
|
||||
|
||||
System.out.println(((1000 * TOTAL_OPERATIONS) / elapsed)
|
||||
+ " ops to build Strings");
|
||||
System.out.println(((1000 * TOTAL_OPERATIONS) / elapsed)
|
||||
+ " ops to build Strings");
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user