You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
600 B
35 lines
600 B
package mightypork.test;
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
public class TestRandomSeed {
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
|
|
{
|
|
Random rand = new Random();
|
|
long begin = System.currentTimeMillis();
|
|
|
|
for (int i = 0; i < 1000000; i++) {
|
|
rand.setSeed(1000);
|
|
}
|
|
|
|
System.out.println((System.currentTimeMillis() - begin) / 1000D);
|
|
}
|
|
|
|
{
|
|
long begin = System.currentTimeMillis();
|
|
|
|
for (int i = 0; i < 1000000; i++) {
|
|
Random rand = new Random();
|
|
rand.setSeed(1000);
|
|
}
|
|
|
|
System.out.println((System.currentTimeMillis() - begin) / 1000D);
|
|
}
|
|
|
|
}
|
|
}
|
|
|