b9f9aa4499
[BENCHMARK] * NEW: Add java benchmarks. Note that 'string' and 'string2' benchmarks are too slow when run with the Java interpreter. So they are just run with Java and JIT compilation enabled.
31 lines
483 B
Text
Executable file
31 lines
483 B
Text
Executable file
#!/usr/bin/java --source 11
|
|
|
|
import java.time.Instant;
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
public final class string
|
|
{
|
|
public static void main(String[] args)
|
|
{
|
|
StringBuffer sb = new StringBuffer();
|
|
String s;
|
|
int i;
|
|
String c;
|
|
int j;
|
|
|
|
for (i = 1; i <= 1000000; i++)
|
|
{
|
|
for (j = 65; j <= 90; j++)
|
|
{
|
|
c = Character.toString(j);
|
|
sb.append(".(");
|
|
sb.append(c);
|
|
sb.append(")");
|
|
}
|
|
}
|
|
|
|
s = sb.toString();
|
|
System.out.println(s.length());
|
|
}
|
|
}
|
|
|