I am trying to get a function that will be called every day. My code now looks like this:
do {
Thread.sleep(1000*60*60*24);
readInFile();
} while (true);
The problem is that it is called every day, plus the time it takes to complete the function readInFile
. Is there a way to make a callback or something to go out every 24 hours?
source
share