Ambien leaves your system within 5 hours. It is designed to put you into REM sleep faster, so that fewer hours of sleep feels more restful. It is safe to take if you are racing--they allow truck drivers and pilots to take it, whereas Benadryl will make you sleepy, but may leave you more groggy in the morning. Of course, you need a prescription for Ambien, but I think it would be a much better choice if you can get it. Lunesta is also a new drug that is supposed to help you fall asleep if you are having trouble calming your thoughts the night before. I don't know how long that stays in your system though. However, I would recommend first trying something like the "relaxation response" or some other meditation technique to try to clear your mind so you can get adequate rest.