My regards, this is a tough predicament; I've faced it numerous times with small pets (young & old), livestock, and recently with an elderly relative. With the old timers, it's tough because you've created a very personal bond with them over the years, but on the other hand you know that, at their age, their quality of life is very likely going to deteriorate. Is their life worth a few more months or another year just for them to suffer and have a very poor quality of life? That's a personal call.
For me, depending on what ailment the animal was suffering from, I'd kill them right away or give them a short window of time to improve. No or minimal improvement equals euthanasia. For the relative, obviously there was some input from her personally, but we put her on a morphine drip which knocked her out and shut down her respiratory system, and she passed while unconscious. Again, my regards to you.