Does anyone know how long a dose of Xanax lasts?

My vet gave me Xanax for Logan for his thunderstorm phobia. The prescription said it was ok to give him a second dose if the first didn't seem to be working. We were having a hell of a storm around noon and I ended up giving him two. Now he's lurching around the room like a drunk.

I don't want to try to walk him while he's this way, so I was just curious whether any of y'all knew how long a dose of Xanax lasts. He's awake and alert, just a bit...off.