本文介绍了如何以及何时在MySQL中正确使用SLEEP()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
In relation to my other question today I am wondering how to use MySQL's SLEEP(duration)
correctly.
从我收集的阅读MySQL Dev论坛和MySQL文档中非常模糊的描述的内容来看,我不能以这种方式使用它:
From what I gathered reading MySQL Dev forums and very vague description in MySQL Docs I can't use it this way:
SELECT ...
SLEEP(1); /* wait for a second before another SELECT */
SELECT ...
那有什么好处呢?
推荐答案
SELECT ...
SELECT SLEEP(5);
SELECT ...
但是您将其用于什么?您是否要规避/重新设计互斥锁或事务?
But what are you using this for? Are you trying to circumvent/reinvent mutexes or transactions?
这篇关于如何以及何时在MySQL中正确使用SLEEP()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!