You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
692B

  1. #include <benchmark/benchmark.h>
  2. #include "dsp/noise.hpp"
  3. using namespace bogaudio::dsp;
  4. static void BM_WhiteNoise(benchmark::State& state) {
  5. WhiteNoiseGenerator g;
  6. for (auto _ : state) {
  7. g.next();
  8. }
  9. }
  10. BENCHMARK(BM_WhiteNoise);
  11. static void BM_PinkNoise(benchmark::State& state) {
  12. PinkNoiseGenerator g;
  13. for (auto _ : state) {
  14. g.next();
  15. }
  16. }
  17. BENCHMARK(BM_PinkNoise);
  18. static void BM_RedNoise(benchmark::State& state) {
  19. RedNoiseGenerator g;
  20. for (auto _ : state) {
  21. g.next();
  22. }
  23. }
  24. BENCHMARK(BM_RedNoise);
  25. static void BM_GaussianNoise(benchmark::State& state) {
  26. GaussianNoiseGenerator g;
  27. for (auto _ : state) {
  28. g.next();
  29. }
  30. }
  31. BENCHMARK(BM_GaussianNoise);