Doing something like this in a web application is somewhere between difficult and unstable to impossible. Web applications are simply not designed to run non-stop, only to respond to requests.
Do you really need to do the calculations every ten minutes? I found that in most cases when someone asks such a question, they really just need something to work at intervals, but so far no one visits the page to see the results, the results do not really need to be calculated.
If this is the case in your case, then you just need to keep track of when the calculations were last performed, and for each request, check if there is enough time to recount.
Guffa source
share