Ziyad delayed the prayer, so Ibn Samit came to me. I set out a chair for him and he sat on it. I mentioned to him what Ziyad had done. He bit his lip, struck my thigh, and said, "I asked Abu Dharr the same question you asked me, and he struck my thigh just as I struck yours, and said, 'I asked the Messenger of Allah ﷺ the same question you asked me, and he struck my thigh just as I struck yours, and said, peace and blessings be upon him, "Pray the prayer at its proper time. Then if you catch it with them, pray with them as well, and do not say, 'I have already prayed, so I will not pray.'"'"
أخبرنا زياد بن أيوب قال حدثنا إسمعيل ابن علية قال حدثنا أيوب
أخر زياد الصلاة فأتاني ابن صامت فألقيت له كرسيا فجلس عليه فذكرت له صنع زياد فعض على شفتيه وضرب على فخذي وقال إني سألت أبا ذر كما سألتني فضرب فخذي كما ضربت فخذك وقال إني سألت رسول الله ﷺ كما سألتني فضرب فخذي كما ضربت فخذك فقال عليه الصلاة والسلام صل الصلاة لوقتها فإن أدركت معهم فصل ولا تقل إني صليت فلا أصلي
Muslim narrated it in the chapter on Mosques, in the section on the dislike of delaying the prayer past its preferred time, etc., hadith 648/242, from the hadith of Ismail bin Ulaya, through him, and it is also in Al-Kubra, hadith 854.