Avatar ·

How to implement a function that works at a certain time?

📁 method

The task is to make a method that works at a certain hour.

I suppose you need to do this in an asynchronous method (so as not to interfere with the main program). I only have an idea to check the system time after some interval (loop) and, if the hour matches, then execute some function, but isn't there really another way? In case it's not an hour, but a minute.