Arduino ESP32 timer API

You need to use a different platform URL in your platformio.ini to get Arduino-ESP32 3.x support. E.g., as discussed in this topic and this topic:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

to get Arduino-ESP32 3.1.3.

This is because PlatformIO and Espressif are in a now year-long disagreemen about the support of the Espressif chips in the official platform (https://github.com/platformio/platform-espressif32/).