check_times utility function