Skip to content

Commit

Permalink
Remove buffer operations from ProcessDurations
Browse files Browse the repository at this point in the history
  • Loading branch information
KangarooKoala committed Oct 10, 2024
1 parent bb9c804 commit 3d51e99
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions wpimath/src/test/native/cpp/TimeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,6 @@ void ProcessDurations(const wpi::array<units::nanosecond_t, N>& durations,
units::nanosecond_t std_dev = units::math::sqrt(sum_squares / N);

wpi::print("{}Mean: {}, Std dev: {}\n", prefix, mean, std_dev);

wpi::array<units::nanosecond_t, 10> buffer{wpi::empty_array};

for (size_t i = 0; i < 10; ++i) {
buffer[i] = durations[i];
}

wpi::print("{}First 10: {}\n", prefix, buffer);

for (size_t i = 0; i < 10; ++i) {
buffer[i] = durations[N - 10 + i];
}

wpi::print("{}Last 10: {}\n", prefix, buffer);

wpi::array<units::nanosecond_t, N> sorted{durations};
std::sort(sorted.begin(), sorted.end());

for (size_t i = 0; i < 10; ++i) {
buffer[i] = sorted[i];
}

wpi::print("{}Fastest 10: {}\n", prefix, buffer);

for (size_t i = 0; i < 10; ++i) {
buffer[i] = sorted[N - 10 + i];
}

wpi::print("{}Slowest 10: {}\n", prefix, buffer);
}

template <size_t N>
Expand Down

0 comments on commit 3d51e99

Please sign in to comment.