为什么Random这么慢?
int num = 10000;
long l = System.currentTimeMillis();
Integer n = null;
for (int i = 0; i < num; i++)
{
n = new Integer(new Random().nextInt(num*50));
Thread.sleep(1);
}
l -= System.currentTimeMillis();
System.out.println("random:"+(-l)+"ms");
out: 19828ms,ji基本上一个Random花了1ms why?