Call me crazy, but the OP is not asking for just working code. He's asking how to improve or whether it is good the code he already has, in order to fix or ignore that warning.
So I will try to answer your question: that kind of warning should never be ignored. It means that whatever your code does takes a long time to finish, and in slower servers it could also mean that your script gets aborted in the middle of its execution, throwing errors and not doing what you want it to do. You need to fix up your code, so it doesn't suck up all the limited CPU time the computer has.
I hear you asking: "but if my code does really need that time, how can I avoid this?" In that case you can't make your code take less time, but you can distribute the total time it takes in slices by using coroutines. They allow to pause and resume execution of functions, so while they are paused the server can use that CPU time to take care of another things, and in turn don't freeze everything else. When using coroutines, you are basically letting the PC to take a break from time to time, to allow him to dedicate his resources to another pieces of code.
So you should fix your code by making appropiate use of coroutines, in order to don't freeze your server and don't see warnings while it executes.
But if for some reason you are lazy, you can't really get to coroutines usage or you simply want to do performance tests, you can disable the MTA: SA hook that throws that warnings:
debug.sethook()
But beware: disabling that hook is NOT a programming practice that should be used in production scripts. It is only intended for development purposes, not as a everyday solution to avoid coroutines. And it won't stop your server from freezing or even crashing; instead, it will make the problem worse, because if your script executes infinitely for some reason you will have to restart the entire server to stop it.