Amazon interview question

write code which returns error if we got 10 packets within 10 seconds