Read the box your pasta came in. While this is not a totally foolproof guide to perfect pasta, the information on the box can be a helpful guideline for preventing your pasta from becoming limp. Also, it is important that you do this every time you use a different brand or type of pasta (i.e., macaroni, linguine, rigatoni, etc.). Larger, thicker noodles will take longer to cook than small or fine noodles such as angel hair.
Set your timer for 1 or 2 minutes under the minimum recommended cooking time. This is when you should start testing your pasta for doneness. Your pasta can become limp from overcooking in just a minute or two, so be careful to respond quickly to the timer.
Gently scoop a few -- not just one -- noodles from the pot of boiling water. Let them cool for a moment, then test them as quickly as possible. You don't want your pasta to overcook while you are waiting for your sample to cool. The pasta should still be slightly firm. It should not be crunchy, but if you are serving the pasta with a hot dish, it is okay if the pasta feels slightly underdone because it will continue to soften with the heat for several minutes after you remove it from the water. If you do not feel the pasta is sufficiently done, continue testing it every 30 to 60 seconds, immediately removing it from the heat and draining it in a colander when it is done.
Try a quick flush with cool water to stop the cooking process and firm the pasta slightly, if you strain your pasta and realize you overcooked it. If you have time, cooling the pasta in the refrigerator, then reheating, can also make your pasta regain some of its firmness.