Skip to content

Commit 181311b

Browse files
committed
tests sine display samples per second
1 parent 5cb2b8a commit 181311b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/tests/performance/sine/sine.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ int sec = 5;
88

99
size_t measure(int sec, SoundGenerator<int16_t> *gen){
1010
uint64_t end = millis()+(1000*sec);
11-
size_t count;
11+
size_t count = 0;
1212
while(millis()<end){
1313
int16_t s = gen->readSample();
1414
count++;
1515
}
16-
return count;
16+
return count / sec;
1717
}
1818

1919
const char* resultStr(const char* name, size_t count){
@@ -24,7 +24,7 @@ const char* resultStr(const char* name, size_t count){
2424

2525
void setup(){
2626
Serial.begin(115200);
27-
Serial.print("Number of calls in ");
27+
Serial.print("Number of samples per sec during ");
2828
Serial.print(sec);
2929
Serial.println(" seconds:");
3030
}

0 commit comments

Comments
 (0)