\begin{algorithm}
\KwData{
\textbf{list} $tasks$,
- \textbf{time} $t$
+ \textbf{time} $tm$
}
\Begin{
receive\_data()\;
}
- $t\leftarrow \text{now}()$\;
+ $tm\leftarrow \text{now}()$\;
\ForEach{$t\leftarrow tasks$}{
\uIf{is\_interrupt$(t)$ \textbf{and} had\_interrupt$(t)$}{
run\_task$(t)$\;
}
- \ElseIf{$t-t.\text{lastrun} > t.\text{interval}$}{
+ \ElseIf{$tm-t.\text{lastrun} > t.\text{interval}$}{
run\_task$(t)$\;
\uIf{$t.\text{interval}==0$}{
delete\_task$(t)$\;