After my total knee replacement in August, my surgeon prescribed pills that contained both hydrocodone (an opiate) and acetaminophen in the same pill. Those were great, but I didn't take many of them even the first week, and quit taking them entirely shortly after that because I didn't need that much pain control. (I know, I know, I was one of the lucky ones.)
Then, for a month and a half, I didn't sleep for more than an hour or two most nights! It was worse than engineering school. At first I could not figure out why. Turned out that because I am a very light sleeper who does some major flopping around while asleep, my *extremely* mild, almost imperceptible pain at that point, was keeping me from sleeping. I tried one of the prescription pain pills and slept like a rock for hours and hours. So I suspected that pain might be the cause of my sleep issues. But really I felt like opiates were overkill in my case.
So, I tried generic OTC acetaminophen, 1000 mg, an hour before bedtime. Works perfectly and I have slept 7-8 hours every night since (except last night, 9.5 hours!).
I *never* had any luck with acetaminophen before, but it works surprisingly well for my knee. I don't take it at any time except bedtime.
Other treatments: Before my total knee replacement, I tried Celebrex back in 2000-2001, which worked, but then quit taking them due to one of those media scares about its safety (which I think must have been over-hyped). I just toughed it out with no medication for quite a while, but the pain got worse and worse through the years. In 2016 I took prescription Meloxicam, which works wonderfully but it is an NSAID and despite claims that it doesn't bother one's stomach, it bothered mine. So I quit taking them. Finally this year I bought and used
an icing machine that I thought really helped with knee pain even before my surgery. It reduces swelling, and although it doesn't eliminate all pain, it eliminates any pain that is due to swelling. But, when I got the torn meniscus as well as the bad osteoarthritis in that knee, I decided that enough is enough and went ahead and had the total knee replacement done.
Medicare plus my BCBS insurance (mostly Medicare I think) paid every cent of the total knee replacement except for about $10-$20 for the pain pills.