add a task decorator to add a delay function on functions
Fix the iteration over PriorityQueueSet which was not correct