Skip to content

Commit 119f632

Browse files
committed
sine.ino
1 parent 8bbec1a commit 119f632

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/tests/performance/sine/sine.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
SineWaveGenerator<int16_t> sine_wave(32000); // subclass of SoundGenerator with max amplitude of 32000
55
SineFromTable<int16_t> sine_table(32000); // subclass of SoundGenerator with max amplitude of 32000
66
FastSineGenerator<int16_t> sine_fast(32000);
7-
int sec = 5;
87

98
size_t measure(int sec, SoundGenerator<int16_t> *gen){
109
uint64_t start = millis();
1110
size_t count = 0;
12-
for(int i=0;i<100000;i++){
11+
for(int i=0;i<1000000;i++){
1312
int16_t s = gen->readSample();
1413
}
1514
uint64_t timeMs = millis()-start;
1615
// calculate samples per second
17-
return 100.0 / timeMs;
16+
return 1000000.0 / timeMs *1000;
1817
}
1918

2019
const char* resultStr(const char* name, size_t count){

0 commit comments

Comments
 (0)