These times vary for each species. For many borer problems, spraying will not be the best answer for control. Insects that have already invaded the tree cannot be killed with chemicals. You will usually use chemicals to prevent further attack. Check with your local nursery person, arborist, garden store clerk or county extension agent for help in diagnosing the problem.
Some borers are secondary pests.
They attack trees that are dying or dead from other causes and are not the ultimate cause of death. Controlling these secondary pests will do little to solve the primary problem with the tree. You should consider anything that will strengthen the health of the tree. Actions you can take include fertilizing, watering and pruning. North Dakota birches, Scotch pines, honeylocust, ash and dying poplars are the most common woody plants attacked by borers.