It is important to know what the half-life is of your sleep medication. Hypnotic drugs that induce and maintain sleep differ by half-life. Half-life refers to how long a drug is active in the body. Drugs that have a shorter half-life are effective in the body for a shorter time. Shorter half-lives are usually preferred so that daytime functioning is not impaired the next day or after waking.
So talk to your doctor about the half-life of your sleep medication, especially if you feel impaired during the day after taking your medication.