int ptask_deadline_miss() { struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); if (tspec_cmp(&now, &_tp[ptask_idx].dl) > 0) return 1; else return 0; }
void tstat_record (int i) { tspec now; clock_gettime (CLOCK_THREAD_CPUTIME_ID, &now); tspec delta = tspec_sub (&now, &measures[i].last); if (tspec_cmp (&delta, &measures[i].wcet) > 0) measures[i].wcet = delta; measures[i].last = now; measures[i].num_instances++; }