Input: a reference task and current time
Output: the amount of lower-priority work needed to be done before
if   is identical to  then return 0;
 Identify the task that has the earliest upcoming deadline among the tasks
  whose priorities are lower than that of ;
CalcLowerPriorityWork( , t, );
;
if   is multiple of  then  ;
 max ;
return  ;
Algorithm 3: CalcLowerPriorityWork(additional slack ).