Sayyiduna Talhah bin Ubaydullah al-Taymi (may Allah be pleased with him) narrates that two men from the tribe of Bali came to him (peace and blessings be upon him) together and accepted Islam together. One of them strove hard in good deeds; he once took part in a military expedition and was martyred. The other lived for a year after him, then he too died. Sayyiduna Talhah (may Allah be pleased with him) said: Once, in a dream, we were at the gate of Paradise, and I saw that I was with the two of them. Then someone came out of Paradise and gave permission to the one of the two who had died later. Then he went back and gave permission to the one who had been martyred. Then he came back to me and said: "Go back, your time has not yet come." In the morning Sayyiduna Talhah (may Allah be pleased with him) told the people about it, and they were amazed at it. This reached the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) said: "What are you amazed at?" They said: O Messenger of Allah, this one was the more hard-striving of the two, and he was also martyred in the path of Allah Almighty, yet he entered Paradise later, and the one who went later entered first. He (peace and blessings be upon him) said: "Did he not live for a year after him, and reach the month of Ramadan and fast it?" They said: Certainly. He (peace and blessings be upon him) said: "And how many prostrations did he perform in the year?" They said: Certainly. Then he (peace and blessings be upon him) said: "Then the distance between the two of them is that between the heavens and the earth (in reward)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6530