I feel like, in a while loop you should be using getRealTime();
we want to remove all of the items that are over 18 seconds old on that tick
the while loop should not take more than a millisecond unless there are like 15,000 pizza items in which case it may take like 2ms
I also notice weird nonsensical jumps when using
getRealTime(); that I can't explain, leading me to believe its not perfectly accurate

i think in this case using sim time will be better