How could the first 3 days be measured without the sun?

If God didn't create the sun until day 4 how could each of the previous 3 days have been 'real' days? Although we are not told what the light source was, the Bible says that God created the earth and light on the first day. Thus we can deduce that on the first 3 days the Earth was already rotating in space relative to God's created light enabling a day-night cycle. In the book of revelation we read that in the future new heavens and Earth there will, once again, be no need for sun.

Helpful Resources
The Bible declares: In the beginning God created the heavens and the earth. Genesis 1:1