btest.c
int timespec_cmp(struct timespec *t1, struct timespec *t2)
{
	if (t1->tv_sec < t2->tv_sec) {
		return(-1);
	} else if (t1->tv_sec > t2->tv_sec) {
		return(1);
	} else {
		if (t1->tv_nsec < t2->tv_nsec) {
			return(-1);
		} else if (t1->tv_nsec > t2->tv_nsec) {
			return(1);
		} else {
			return(0);
		}
	}
}
/* Return -1, 0, or +1 if t1 less than, equal to or greater than t2 */
1, 0, or +1 if t1 less than, equal to or greater than t2
1 0 or + 1 if t1 less than equal to or greater than t2
int timespec_cmp(struct timespec *t1, struct timespec *t2)
{
	if (t1->tv_sec < t2->tv_sec) {
		return(-1);
	} else if (t1->tv_sec > t2->tv_sec) {
		return(1);
	} else {
		if (t1->tv_nsec < t2->tv_nsec) {
			return(-1);
		} else if (t1->tv_nsec > t2->tv_nsec) {
			return(1);
		} else {
			return(0);
		}
	}
}
int timespec_cmp ( struct timespec * t1 , struct timespec * t2 ) { if ( t1 -> tv_sec < t2 -> tv_sec ) { return ( -1 ) ; } else if ( t1 -> tv_sec > t2 -> tv_sec ) { return ( 1 ) ; } else { if ( t1 -> tv_nsec < t2 -> tv_nsec ) { return ( -1 ) ; } else if ( t1 -> tv_nsec > t2 -> tv_nsec ) { return ( 1 ) ; } else { return ( 0 ) ; } } }
Return -1, 0, or +1 if t1 less than, equal to or greater than t2
Return - 1 0 or + 1 if t1 less than equal to or greater than t2