摘要:
快速生成50W个16位的不重复的随机整数经测试,生成50W个不到1秒,500W两秒左右,1000W以上的话可能会内存溢出 Random rnd = new Random(); HashSet hs = new HashSet(); for (int i = 0; i < 500000; i++) { long l = (long)((rnd.NextDouble() + rnd.Next(1, 9)) / 10 * 9999999999999999); ... 阅读全文