struct timespec tp; while (1) { ibv_get_cq_event(); // Only necessary for event based polling while (ibv_poll_cq()) { clock_gettime(CLOCK_MONOTONIC, &tp); /** * Save tp and message identifier in an array and * return as soon as possible, so that as little * as possible time is lost before polling goes on. */ } ibv_req_notify_cq(); // Only necessary for event based polling }