diff options
author | ExMix <rahuba.youri@gmail.com> | 2013-03-22 16:28:45 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:52:10 +0300 |
commit | 71c10ab1a0b3dab811c43869efcf24d87aced66d (patch) | |
tree | 94304ba65e716df77811a305019146f93098836c /map/benchmark_engine.cpp | |
parent | 57cf499bc8cb4f3a89af451a15ddf11d1c2daf92 (diff) |
Add possibility to run benchmark cyclically
Diffstat (limited to 'map/benchmark_engine.cpp')
-rw-r--r-- | map/benchmark_engine.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/map/benchmark_engine.cpp b/map/benchmark_engine.cpp index a5c6e3b63d..754ee5c0a9 100644 --- a/map/benchmark_engine.cpp +++ b/map/benchmark_engine.cpp @@ -139,8 +139,6 @@ BenchmarkEngine::BenchmarkEngine(Framework * fw) m_maxDuration(0), m_framework(fw) { - m_startTime = my::FormatCurrentTime(); - // m_framework->GetInformationDisplay().enableBenchmarkInfo(true); } @@ -172,7 +170,7 @@ void BenchmarkEngine::SaveBenchmarkResults() string resultsPath; Settings::Get("BenchmarkResults", resultsPath); - ofstream fout(GetPlatform().WritablePathForFile(resultsPath).c_str()); + ofstream fout(GetPlatform().WritablePathForFile(resultsPath).c_str(), ios::app); for (size_t i = 0; i < m_benchmarkResults.size(); ++i) { /// @todo Place correct version here from bundle (platform). @@ -255,13 +253,22 @@ void BenchmarkEngine::Do() { PrepareMaps(); - DoGetBenchmarks<Benchmark> doGet(m_benchmarks, m_framework->m_navigator); - ForEachBenchmarkRecord(doGet); + int benchMarkCount = 1; + Settings::Get("BenchmarkCyrcleCount", benchMarkCount); + + for (int i = 0; i < benchMarkCount; ++i) + { + DoGetBenchmarks<Benchmark> doGet(m_benchmarks, m_framework->m_navigator); + ForEachBenchmarkRecord(doGet); + + m_curBenchmark = 0; - m_curBenchmark = 0; + m_benchmarksTimer.Reset(); + m_startTime = my::FormatCurrentTime(); - m_benchmarksTimer.Reset(); + MarkBenchmarkResultsStart(); + while (NextBenchmarkCommand()){}; - MarkBenchmarkResultsStart(); - while (NextBenchmarkCommand()){}; + m_benchmarks.clear(); + } } |