1
0
This commit is contained in:
Tiger Wang 2014-04-18 20:17:52 +01:00
commit 598719d7ab
2 changed files with 35 additions and 0 deletions

View File

@ -70,6 +70,40 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Performance test of the NetherFort generator:
/*
#include "OSSupport/Timer.h"
static class cNetherFortPerfTest
{
public:
cNetherFortPerfTest(void)
{
cTimer Timer;
long long StartTime = Timer.GetNowTime();
const int GridSize = 512;
const int MaxDepth = 12;
const int NumIterations = 100;
for (int i = 0; i < NumIterations; i++)
{
cNetherFortGen FortGen(i, GridSize, MaxDepth);
delete new cNetherFortGen::cNetherFort(FortGen, 0, 0, GridSize, MaxDepth, i);
}
long long EndTime = Timer.GetNowTime();
printf("%d forts took %lld msec (%f sec) to generate\n", NumIterations, EndTime - StartTime, ((double)(EndTime - StartTime)) / 1000);
exit(0);
}
} g_PerfTest;
//*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cNetherFortGen:

View File

@ -26,6 +26,7 @@ public:
virtual ~cNetherFortGen();
protected:
friend class cNetherFortPerfTest; // fwd: NetherFortGen.cpp
class cNetherFort; // fwd: NetherFortGen.cpp
typedef std::list<cNetherFort *> cNetherForts;