Ecclesiastes 3:17 Midrash

אָמַ֤רְתִּֽי אֲנִי֙ בְּלִבִּ֔י אֶת־הַצַּדִּיק֙ וְאֶת־הָ֣רָשָׁ֔ע יִשְׁפֹּ֖ט הָאֱלֹהִ֑ים כִּי־עֵ֣ת לְכָל־חֵ֔פֶץ וְעַ֥ל כָּל־הַֽמַּעֲשֶׂ֖ה שָֽׁם׃

I said in my heart: ‘The righteous and the wicked God will judge; for there is a time there for every purpose and for every work.’

Read midrashic interpretation of Ecclesiastes 3:17: and classical rabbinic exegesis.