diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-18 21:17:52 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-18 21:17:52 +0200 |
commit | 598719d7ab36e410e60137d98337c1129a483a6a (patch) | |
tree | 4dbc1d71c2eddda028449ed2cf8777554e872249 /src/Generating/NetherFortGen.cpp | |
parent | Fixed #906 (diff) | |
parent | Added performance test of the nether fort generator. (diff) | |
download | cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar.gz cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar.bz2 cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar.lz cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar.xz cuberite-598719d7ab36e410e60137d98337c1129a483a6a.tar.zst cuberite-598719d7ab36e410e60137d98337c1129a483a6a.zip |
Diffstat (limited to 'src/Generating/NetherFortGen.cpp')
-rw-r--r-- | src/Generating/NetherFortGen.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Generating/NetherFortGen.cpp b/src/Generating/NetherFortGen.cpp index 7dc702e3a..d90fdeb0a 100644 --- a/src/Generating/NetherFortGen.cpp +++ b/src/Generating/NetherFortGen.cpp @@ -71,6 +71,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: cNetherFortGen::cNetherFortGen(int a_Seed, int a_GridSize, int a_MaxDepth) : |