Add timeval_compare helper function