The answer is fairly simple, even if the details aren’t:
We have a clock in our brain. Or several.
https://nigms.nih.gov/education/fact-sheets/Pages/circadian-rhythms.aspx
There are additional factors, mostly to do with being able to process our surroundings and memory that affect how well we can judge the exact outside passage of time.
https://www.scientificamerican.com/article/your-brain-has-two-clocks/
Latest Answers