English : Vol. 1, Book 5, Hadith 945
Grading supplied with this record: Sahih (Darussalam)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لَوْ يَعْلَمُ أَحَدُكُمْ مَالَهُ أَنْ يَمُرَّ بَيْنَ يَدَىْ أَخِيهِ وَهُوَ يُصَلِّي كَانَ لأَنْ يَقِفَ أَرْبَعِينَ - قَالَ لاَ أَدْرِي أَرْبَعِينَ عَامًا أَوْ أَرْبَعِينَ شَهْرًا أَوْ أَرْبَعِينَ يَوْمًا - خَيْرٌ لَهُ مِنْ ذَلِكَ "
It was narrated from Busr bin Sa'eed that Zaid bin Khalid sent word to Abu Juhaim Al-Ansari asking him:
"What did you hear from the Prophet (ﷺ) about a man when he is performing prayer?" He said: "I heard the Prophet (ﷺ) saying: "If anyone of you knew (how great is the sin involved) when he passed in front of his brother who is performing prayer, then waiting for forty'," (one of the narrators) said: "I do not know if he meant forty years, forty months, or forty days, "would be better for him than that."
Full reference and source
English : Vol. 1, Book 5, Hadith 945 Arabic : Book 5, Hadith 998
View source on Sunnah.com (opens in a new tab)