Time limited algorithm