summaryrefslogtreecommitdiff
path: root/platform/ios/benchmark
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2016-04-14 19:46:59 -0400
committerJason Wray <jason@mapbox.com>2016-04-14 22:33:33 -0400
commit253a007d99c2079b95d5c6d11715e16815067e16 (patch)
tree23389b882d59829e205121f0faa53f5298e51cc0 /platform/ios/benchmark
parentd2b9b1c348ba71189792f1f6ba6c450729cd9a12 (diff)
downloadqtlocation-mapboxgl-253a007d99c2079b95d5c6d11715e16815067e16.tar.gz
[ios][bench] Add total and avg FPS to final summary
Diffstat (limited to 'platform/ios/benchmark')
-rw-r--r--platform/ios/benchmark/MBXBenchViewController.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/ios/benchmark/MBXBenchViewController.mm b/platform/ios/benchmark/MBXBenchViewController.mm
index a381813ffc..3d8034b2b3 100644
--- a/platform/ios/benchmark/MBXBenchViewController.mm
+++ b/platform/ios/benchmark/MBXBenchViewController.mm
@@ -81,13 +81,17 @@ static const int benchmarkDuration = 200; // frames
// Do nothing. The benchmark is completed.
NSLog(@"Benchmark completed.");
NSLog(@"Result:");
+ double totalFPS = 0;
size_t colWidth = 0;
for (const auto& row : result) {
colWidth = std::max(row.first.size(), colWidth);
}
for (const auto& row : result) {
NSLog(@"| %-*s | %4.1f fps |", int(colWidth), row.first.c_str(), row.second);
+ totalFPS += row.second;
}
+ NSLog(@"Total FPS: %4.1f", totalFPS);
+ NSLog(@"Average FPS: %4.1f", totalFPS / result.size());
exit(0);
}
}