It is narrated from Hazrat Uqbah bin Amir (may Allah be pleased with him) that I heard the Prophet (peace and blessings be upon him) say: When a person performs ablution and comes to the mosque with the intention of prayer, then for every step he takes towards the mosque, an angel writes ten good deeds for him in exchange for each step, and the one who sits waiting for the prayer is like the one who is engaged in prayer, until he returns.
Hadith Referenceمسند احمد / مسند الشاميين / 17456
Hadith Gradingحکم دارالسلام:حديث صحيح، وهذا إسناد ضعيف، ابن لهيعة سيئ الحفظ