Created
September 12, 2019 06:04
-
-
Save ttldtor/a22b5a72a6040cd7cecd49a4d65356d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ttldtor; | |
import java.util.concurrent.ThreadLocalRandom; | |
public class App { | |
static class A { | |
char c; | |
byte b; | |
int i; | |
long l; | |
String s; | |
A(char c, byte b, int i, long l, String s) { | |
this.c = c; | |
this.b = b; | |
this.i = i; | |
this.l = l; | |
this.s = s; | |
} | |
static A create(ThreadLocalRandom r) { | |
return new A((char) r.nextInt(), (byte) r.nextInt(), r.nextInt(), r.nextLong(), | |
String.valueOf(r.nextLong())); | |
} | |
} | |
public static void main(String[] args) throws InterruptedException { | |
ThreadLocalRandom r = ThreadLocalRandom.current(); | |
while (true) { | |
for (int i = 0; i < 1000000; i++) { | |
A a = A.create(r); | |
} | |
Thread.sleep(r.nextInt(1, 300 + 1)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment