int count = 1000000;
FastRandom pfr = new FastRandom(seed);
FastRandom sfr = new FastRandom(seed);
PerlinNoise pn = new PerlinNoise(seed);
SimplexNoise sn = new SimplexNoise(seed);
for (int i = 0; i < warmUp; i++) {
float posX = pfr.nextFloat() * 1000f;
float posY = pfr.nextFloat() * 1000f;
float posZ = pfr.nextFloat() * 1000f;
pn.noise(posX, posY, posZ);
}
for (int i = 0; i < warmUp; i++) {
float posX = sfr.nextFloat() * 1000f;
float posY = sfr.nextFloat() * 1000f;
float posZ = sfr.nextFloat() * 1000f;
sn.noise(posX, posY, posZ);
}
long start = System.nanoTime();
for (int i = 0; i < count; i++) {
float posX = pfr.nextFloat() * 1000f;
float posY = pfr.nextFloat() * 1000f;
float posZ = pfr.nextFloat() * 1000f;
pn.noise(posX, posY, posZ);
}
logger.info("Perlin Noise : " + (System.nanoTime() - start) / 1000000 + "ms.");
start = System.nanoTime();
for (int i = 0; i < count; i++) {
float posX = sfr.nextFloat() * 1000f;
float posY = sfr.nextFloat() * 1000f;
float posZ = sfr.nextFloat() * 1000f;
sn.noise(posX, posY, posZ);
}
logger.info("Simplex Noise : " + (System.nanoTime() - start) / 1000000 + "ms.");
}