How it works...
The measure_time function helped us measure how long the execution took for the show_weather function. This function is fetching data from the internet, parsing it, and then performing a number of screen operations to display it. The measured execution time was around 2 seconds. Microcontrollers, compared to desktop computers, have limited computational power. Operations like these on a desktop would take a few hundred milliseconds, but on a microcontroller can take longer. Because of this noticeable execution time, we have enhanced the show_weather function by inverting the colors at the very start of its execution. This color inversion will be shown within a few milliseconds and will be displayed before any other processing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access