-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
処理時間を計測する #9
Comments
auto start_time = micros();
M5.update();
M5_LOGI("elapsed time [us]:%d", micros() - start_time); |
コマンド受信(データがないとき): 58 ~ 68 usec auto start_time = micros();
if(g_receiver.receive()) {
// M5_LOGD("Received command!");
}
M5_LOGI("elapsed time:%d", micros() - start_time); |
I2Cのデータ送信(100kHz):819 ~ 827 usec auto start_time = micros();
const unsigned char SLAVE_ADDR = 0x54;
Wire1.beginTransmission(SLAVE_ADDR);
Wire1.write(send_data, DATA_SIZE);
if(Wire1.endTransmission() == 0) {
// M5_LOGI("Sent command!");
} else {
M5_LOGD("Failed to send command!");
}
M5_LOGI("elapsed time:%d", micros() - start_time); |
loop関数:880 ~ 910 usec i2cのクロックを400kHzに変更後:350 ~ 360 usec unsigned long start_time = 0;
void loop() {
M5_LOGI("elapsed time:%d", micros() - start_time);
start_time = micros(); |
I2Cのデータ送信(400kHz):270 ~ 273 usec Wire1.begin(M5.In_I2C.getSDA(), M5.In_I2C.getSCL(), 400000);
auto start_time = micros();
const unsigned char SLAVE_ADDR = 0x54;
Wire1.beginTransmission(SLAVE_ADDR);
Wire1.write(send_data, DATA_SIZE);
if(Wire1.endTransmission() == 0) {
// M5_LOGI("Sent command!");
} else {
M5_LOGD("Failed to send command!");
}
M5_LOGI("elapsed time:%d", micros() - start_time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
計測方法
The text was updated successfully, but these errors were encountered: