int counter = 0;
int max_loop = 100;
int total_Time;
long millis_at_start;
long last_Millis;
float freq;
// float testa;
// float testb;
void setup() {
Serial.begin(9600);
last_Millis = millis_at_start = millis();
Serial.println(millis_at_start);
}
void loop() {
counter++;
Serial.print(counter);
Serial.print(",");
Serial.println(millis());
// After max_loop loops, stop logging data
// For this part logging time isn't important as all data allready has been stored
if (counter > max_loop) {
total_Time = millis() - millis_at_start;
Serial.println(max_loop);
Serial.println(total_Time);
Serial.println(100000/total_Time);
Serial.println(100*1000);
freq = (max_loop*1000)/total_Time;
Serial.print(freq);
Serial.println(" Hz");
while (1);
}
// while (millis() - myData.current_Millis < 4);
}