Ensure the oil is pre-heated to medium heat before you add the shallots. Another way to test oil temperature: add a piece of shallot in the oil and it should sizzle lightly.
The actual time for frying shallots will depend on the oil temperature. Observe the colour of shallots for doneness. Avoid over-frying, as burnt shallots which will taste bitter.
The heat of the stove may need to be adjusted during cooking to ensure it is always at optimum heat.
Keep shallot oil which has been infused with the wonderful aroma of shallots in a covered container and use it in your cooking as it adds a great flavour to the food.