Last active
December 21, 2015 17:48
-
-
Save toya33/6342513 to your computer and use it in GitHub Desktop.
Arduino 転送帯域チェック用のベンチマーク
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long starttime,endtime,elapsedtime; | |
long baudrate=115200; | |
long number=500; | |
void setup(){ | |
Serial.begin(baudrate); | |
} | |
void loop(){ | |
byte b = 1; | |
starttime=micros(); | |
for(int i=0;i<number;i++){ | |
Serial.println(b); | |
} | |
endtime=micros(); | |
elapsedtime=endtime-starttime; | |
Serial.print("baudrate="); | |
Serial.println(baudrate,DEC); | |
Serial.print("traffic(byte)="); | |
Serial.println(number); | |
Serial.print("elapsedtime="); | |
Serial.println(elapsedtime); | |
delay(10000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment