Events are sorted by periods. So events of larger periods may have trigger time (i.e., when the event should be processed) earlier than the ones of smaller periods. So need to scan the whole queue looking for due events. The scan takes O(n) time but we expect the queue size to be small. Change-Id: I08bd3bd9d4bb8decb78f3c91c943396463ca023a