If you want to wait for 5 seconds in SQL Server code, you will run the following command:
WAITFOR DELAY '00:00:05';
Now the similar code in MySQL can be written in two different ways.
I personally prefer method 2 over method 1. This kind of function can be helpful to test asynchronous queries as well as slow running queries.
In any case, let me know if you have used this kind of function in your production or not. If yes, I would like to know what was the purpose you used this one for. Additionally, leave a comment to this blog post if you want to learn anything new and I will be happy to share that with you.
Let me summarize how you can stay in touch with me if you want my content every single day.
Reference: Pinal Dave (https://blog.sqlauthority.com)