Alprazolam is the active ingredient in the generic and branded forms of Xanax 1mg for sleep and anxiety, and has been proven to be the best treatment for generalised anxiety disorder (GAD). The effects of this medication can be felt within an hour of taking a tablet, and last for an average of six hours. The length of time that it is active can vary significantly depending on the type of pill being taken.