While-loop speed enhancement?
Posted: Wed Feb 10, 2021 5:36 am
Hello,
In my example, while loop in main.c seems working in 1.437ms period
and I need some calculation in us.
Is there any way to enhance while loop speed?
Regards,
In my example, while loop in main.c seems working in 1.437ms period
and I need some calculation in us.
Code: Select all
int64_t oldTime, currentTime;
int16_t deltaTime;
while(1) {
oldTime = currentTime;
currentTime = esp_timer_get_time();
deltaTime = currentTime - oldTime;
printf("deltaTime: %d\n", deltaTime); // deltaTime = 1437
}
Regards,