{As it is stated:} (Exodus 34:28:) "And he was there with the LORD." He was learning Torah by day and expounding it by night, by himself. Why? Only to teach Israel that they should labor in the Torah by day and by night. And from where was he nourished those forty days? From the splendor of the Divine Presence.
Moses Studying Torah Day and Night Nourished by the Shekhinah
Midrash Tanchuma Buber, Ki Tisa 19:4
(שנאמר) ויהי שם עם ה', היה לומד תורה ביום, ופושט אותה בלילה בינו לבין עצמו, למה אלא ללמד לישראל שיהיו יגעים בתורה ביום ובלילה, ומאין היה ניזון אותן מ' ימים, מזיו השכינה.