[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sleep
- From: Petite Abeille <petite.abeille@...>
- Date: Mon, 25 May 2009 19:28:26 +0200
On May 20, 2009, at 10:33 PM, Marco Antonio Abreu wrote:
Hi Guys,
I am writting a script to copy some data from one database to
another, this
script will be running all the time, verifying if have something to
copy.
I need to wait for some seconds between two checks, to do not
overload the
DB server or CPU.
What about using database change notification instead of polling? That
way the database calls you when it has some changes, instead of you
asking if there are any changes all the time...
How can I implement a function (or use if already has) to perform a
"sleep",
to wait some (milli)seconds doing nothing.
If this was not mentioned already, Luiz Henrique de Figueiredo's
lalarm could be used for that purpose:
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lalarm
http://www.opengroup.org/onlinepubs/009695399/functions/alarm.html
Cheers,
--
PA.
http://alt.textdrive.com/nanoki/
- References:
- sleep, Marco Antonio Abreu