Variantly: "from generation to generation": R. Yehoshua says: "from generation" — the life of this world: "to generation" — the life of the world to come. R. Eliezer Hamodai says: from the generation of Moses and from the generation of Samuel, (who commanded that revenge be taken of Amalek.) R. Eliezer says: "from the generation of the Messiah" — two generations. And whence is it derived that the generation of the Messiah is two generations? From (Psalms 72:5) "They will fear You (in the time of the Messiah) with the sun and before the moon, generation, generations."
They Will Fear You in the Time of the Messiah with the Sun and Before
Mekhilta Tractate Amalek 2:51