File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
examples/tests/performance/sine Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 4
4
SineWaveGenerator<int16_t > sine_wave (32000 ); // subclass of SoundGenerator with max amplitude of 32000
5
5
SineFromTable<int16_t > sine_table (32000 ); // subclass of SoundGenerator with max amplitude of 32000
6
6
FastSineGenerator<int16_t > sine_fast (32000 );
7
- int sec = 5 ;
8
7
9
8
size_t measure (int sec, SoundGenerator<int16_t > *gen){
10
9
uint64_t start = millis ();
11
10
size_t count = 0 ;
12
- for (int i=0 ;i<100000 ;i++){
11
+ for (int i=0 ;i<1000000 ;i++){
13
12
int16_t s = gen->readSample ();
14
13
}
15
14
uint64_t timeMs = millis ()-start;
16
15
// calculate samples per second
17
- return 100 .0 / timeMs;
16
+ return 1000000 .0 / timeMs * 1000 ;
18
17
}
19
18
20
19
const char * resultStr (const char * name, size_t count){
You can’t perform that action at this time.
0 commit comments