FreeBSD/usr.sbin/bluetooth/bthidd/bthidd.c
/*
 * Returns true if desired time interval has elapsed
 */
Returns true if desired time interval has elapsed
Returns true if desired time interval has elapsed
static int32_t
elapsed(int32_t tval)
{
	static struct timeval	last = { 0, 0 };
	struct timeval		now;
	gettimeofday(&now, NULL);
	if (now.tv_sec - last.tv_sec >= tval) {
		last = now;
		return (1);
	}
	return (0);
}
static int32_t elapsed ( int32_t tval ) { static struct timeval last = { 0 , 0 } ; struct timeval now ; gettimeofday ( & now , NULL ) ; if ( now . tv_sec - last . tv_sec >= tval ) { last = now ; return ( 1 ) ; } return ( 0 ) ; }
Returns true if desired time interval has elapsed
Returns true if desired time interval has elapsed