Fix the standard deviation calculation in the level controller perf tests.
BUG=webrtc:5920 Review-Url: https://codereview.webrtc.org/2518523002 Cr-Commit-Position: refs/heads/master@{#15186}
This commit is contained in:
parent
820f578f2b
commit
0dbb6f57fc
@ -135,11 +135,11 @@ class SubmodulePerformanceTimer {
|
||||
RTC_DCHECK(!timestamps_us_.empty());
|
||||
double average_duration = GetDurationAverage();
|
||||
|
||||
int64_t variance =
|
||||
std::accumulate(timestamps_us_.begin(), timestamps_us_.end(), 0,
|
||||
[average_duration](const int64_t& a, const int64_t& b) {
|
||||
return a + (b - average_duration);
|
||||
});
|
||||
double variance = std::accumulate(
|
||||
timestamps_us_.begin(), timestamps_us_.end(), 0.0,
|
||||
[average_duration](const double& a, const int64_t& b) {
|
||||
return a + (b - average_duration) * (b - average_duration);
|
||||
});
|
||||
|
||||
return sqrt(variance / timestamps_us_.size());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user