[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico]
[Índice de assunto]
Re: Função nanosleep
- Subject: Re: Função nanosleep
- From: Nelson Posse Lago <lago@that.com.br>
- Date: Tue, 28 May 2002 21:51:05 -0300
On Sat, May 25 2002 at 09:01:55am -0300, Wendel Scardua wrote:
> Não sei se pode usar, mas no unistd.h tem a função usleep() que recebe um int,
> indicando microssegundos para dormir...
Nao me lembro do enunciado (ou seja, nao sei se o Fabio pediu
explicitamente para usar o nanosleep), mas veja o que diz na manpage do
nanosleep:
"Compared to sleep(3) and usleep(3), nanosleep has the advantage of not
affecting any signals, it is standardized by POSIX, it provides higher
timing resolution, and it allows to continue a sleep that has been
interrupted by a signal more easily"
Ou seja, em geral usar o nanosleep e' melhor.
Ate'+
Nelson
--
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth