Charity given during one’s lifetime is better. It was narrated from Abu Hurayrah (may Allah be pleased with him) that a man came to the Prophet (peace and blessings of Allah be upon him) and said: “O Messenger of Allaah, which charity brings a greater reward?” He said, “If you give in charity when you are healthy and miserly, fearing poverty and hoping for richness. Do not delay until you are at the point of death and you say, ‘Give this to So and so, give this to So and so,’ …” (al-Bukhaari, 1330; Muslim, 1713).
So there was a person in the time of the Holy Prophet Muhammad PBUH who had a warehouse of dates and he made his will when I pass away rasulullah sallallahu wasallam should come and distribute all the dates in this warehouse to the poor people of Medina. Such a nice will, such a nice wasiyyat prophet comes he’s (Muhammad PBUH )supervising some of those Sahaba(R.A) and companions are going inside the warehouse bringing the dates and distributing among the poor people in Medina in the supervision of the holy prophet Muhammad PBUH. When all the dates were distributed and prophet Muhammad PBUH inquired and he was told that yes O Prophet Muhammad PBUH nothing is remaining in the warehouse. This is then where a prophet Muhammad PBUH steps inside the warehouse himself. he goes there and he finds there’s one rotten date on the floor. it’s not eatable prophet Muhammad PBUH picks up that rotten date and said if this person has donated this one date in his own lifetime he would have gotten more Reward and Sawab from Allah SWT, than donating all the dates of the warehouse after his death. what do we learn from the story ? we learn from the story that as long as I’m alive my money belongs to me, myself. it’s mine. this is the thinking that Allah is battling against. Allah is teaching us to get rid of this way of thinking. money is not ours .to begin with. it’s an Amana and entrusted trust of Allah. and we are the khalifa of Allah about the money . and give away from what we provided you. it’s Allah’s rizq ( food) it’s not ours. this is the thinking of Munafiqeen(hypocrites) this is the thinking of Qaroon(Korah) it’s not the thinking of momineen that this is my money and I made it with my hard work . Do you think your hard work makes you the money ? and a lot of people who are doing hard work but they don’t end up getting paid . If the hard work was the sufficing reason for making money then everybody doing the hard work should have been paid what he deserves but that’s not the case
Al-Nawawi (may Allaah have mercy on him) said: “Al-Khattaabi said: what this hadeeth means is that miserliness is more likely when one is in good health, so if a person is miserly but he still gives in charity, his intention is more sincere and his reward will be greater, unlike the one who is facing death and no longer has any hope of living. Then he starts to realize that someone else will take his wealth, so his charity in this case is lacking, when compared with charity given when one is in good health. Stinginess is based on the hope of remaining alive and fear of poverty… so a person does not have as much reward for his will, compared to the reward for charity given by one who is healthy and miserly.”
This is a link where you can read about the events towards the End of Times.