Hadithcore
Mishkat al-Masabih, 1244

Anas reported God’s Messenger as saying, “One should pray as long as he is lively, but when he slackens he should stop.” (Bukhari and Muslim.)

وَعَنْ أَنَسٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " لِيُصَلِّ أَحَدُكُمْ نَشَاطَهُ وَإِذَا فَتَرَ فَلْيَقْعُدْ)

References1 variant
In-Book Reference
Book 4, Hadith 659