Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2021 23:55:33 -0400
From:      Kurt Hackenberg <kh@panix.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: sys/timerfd.h missing
Message-ID:  <3fefcffc-ad61-8336-f012-854b4c02a840@panix.com>
In-Reply-To: <e65e10d7-d4f2-ce50-766d-1757bc1e7f5f@wavecable.com>
References:  <15b672e6-8f3b-4c6c-a42c-e955216f630b@wavecable.com> <e65e10d7-d4f2-ce50-766d-1757bc1e7f5f@wavecable.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2021/07/12 22:23, Thomas D. Dean wrote:

> I want to:
> 
> start timer  /* >> loop execution time */
> do something
> while(1)
>    wait timer
>    start timer   /* >> loop execution time */
>    do something
>    do something else


How about the C library function sleep()?

Or for less than a second, usleep(3), nanosleep(2), or 
clock_nanosleep(2). You might also have a use for clock_gettime(2). All 
of those except usleep() are Posix.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3fefcffc-ad61-8336-f012-854b4c02a840>