Skip to content

Commit 4ab0d45

Browse files
committed
test sine
1 parent 5292227 commit 4ab0d45

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

examples/tests/performance/sine/sine.ino

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FastSineGenerator<int16_t> sine_fast(32000);
77
int sec = 5;
88

99
size_t measure(int sec, SoundGenerator<int16_t> *gen){
10-
uint64_t end = millis()+(1000*sec); // 10 seconds
10+
uint64_t end = millis()+(1000*sec);
1111
size_t count;
1212
while(millis()<end){
1313
int16_t s = gen->readSample();
@@ -31,14 +31,10 @@ void setup(){
3131
}
3232

3333
void loop(){
34-
size_t result1 = measure(sec, &sine_wave);
35-
size_t result2 = measure(sec, &sine_table);
36-
size_t result3 = measure(sec, &sine_fast);
37-
38-
Serial.print(resultStr("SineWaveGenerator", result1));
34+
Serial.print(resultStr("SineWaveGenerator", measure(sec, &sine_wave)));
3935
Serial.print(" - ");
40-
Serial.print(resultStr("SineFromTable", result2));
36+
Serial.print(resultStr("SineFromTable", measure(sec, &sine_table)));
4137
Serial.print(" - ");
42-
Serial.print(resultStr("FastSineGenerator", result3));
38+
Serial.print(resultStr("FastSineGenerator", measure(sec, &sine_fast)));
4339
Serial.println();
4440
}

0 commit comments

Comments
 (0)