Real Time Clock (RTC) board for Raspberry-Pi Pico
This RTC board use an DS3231 chip as main component. The DS3231 is well known for the stability of its oscillator (usually sensitive to the temperature) so it offers a great timing precision. The DS3231 chips are known to have a low time drift (the opposite of its little brother DS1307).
This DS3231 RTC module uses an I2C bus to transfert data over the I2C bus. It is a very popular module and it is quite easy to find a driver for Arduino, MicroPython, CircuitPython, etc.
Thank to a CR1220 cell coin the RTC driver would track the time for you even when the microcontroler is shutdown. Once the microcontroler restarted, it can query the RTC module and update its own internal clock to the time.
The RTC board can be queried each time you need to know the current time. It is right to query the RTC from time to time.
If you need to query clock several time per second then it will surge the I2C bus with query and data transfer. As the I2C bus is relatively slow then this will slow down the user code. To keep great performance, it is recommended to transfert the time from the RTC module to the internal microcontroler clock. So the time comparaison code with internal microcontroler clock will qui as fast as a spark. Software performance would be better and the I2C bus traffic would not struggle software execution.
Finally, to eliminates internal clock time drift (less accurate than external RTC), you just need to update the internal microcontroler clock with the RTC time once every while (eg: once every hour).