1
0

Added a (commented-out) performance test for biome generator

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1409 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-04-24 14:34:24 +00:00
parent 817b9ba235
commit 7d039dfa90

View File

@ -168,6 +168,19 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
LOGWARNING("Unknown BiomeGen \"%s\", using \"MultiStepMap\" instead.", BiomeGenName.c_str());
}
m_BiomeGen = new cBioGenMultiStepMap(Seed);
/*
// Performance-testing:
LOGINFO("Measuring performance of cBioGenMultiStepMap...");
clock_t BeginTick = clock();
for (int x = 0; x < 5000; x++)
{
cChunkDef::BiomeMap Biomes;
m_BiomeGen->GenBiomes(x * 5, x * 5, Biomes);
}
clock_t Duration = clock() - BeginTick;
LOGINFO("cBioGenMultiStepMap for 5000 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC);
//*/
}
// Add a cache, if requested: