long initialTime = System.currentTimeMillis();
List<ICompletionProposal> props;
while (true) {
props = waitForQuickFixProps(quickFix, ps, offset);
ICompletionProposalExtension2 completion = findCompletion(props, expectedCompletion, false);
if (completion != null) {
return completion;
}
if (System.currentTimeMillis() - initialTime > 10000) {
break; //Give it 10 seconds to work.