An extension of the standard Python queue that only stores elements for a given number of seconds before being removed. Useful if you don’t know the volume of data being added to the queue but need to limit it in some way.

There is no decrease in performance when removing items.

Without item removal 

Queue size: 10000

real 0m10.771s
user 0m0.217s
sys 0m0.028s

With item removal 

Queue size: 4659

real 0m10.765s
user 0m0.203s
sys 0m0.028s