It is narrated from Hazrat Uqbah bin Amir (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: 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 praying, and he is written among the worshippers until he returns.
Hadith Referenceمسند احمد / مسند الشاميين / 17459
Hadith Gradingحکم دارالسلام:حديث صحيح ، وهذا إسناد ضعيف من أجل ابن لهيعة، وهو سيئ الحفظ