It seems very probable that everything about us stems from the evolution of something at some level (chemical, genetic, behavioural, conceptual).
It seems that the reality within which we exist has many aspects that are predictable on a time related basis – days, seasons, etc.
Any animal that can better predict where and when food or mates or danger will be will be better off than those that can’t, provided that the cost in time and food of doing so isn’t too high.
I fed our Labrador precisely at 5:30pm for many years – had an alarm clock that reminded me. The dog got very good at predicting time. If I hadn’t gotten out of my chair by 5:31 her nose would be under my elbow. She could judge a 24 hours period to within a minute of accuracy, reliably (in fact she just did it to me this evening, as I had lost track of time writing this – her nose hit my elbow at 5:31).
The evolution of consciousness is an extremely complex topic, that very few people have any significant degree of understanding of.
In a very simple model, it seems that what we experience as reality is not reality itself, but rather a predictive “virtual reality” generated by the subconscious systems of our brains. As conscious software entities, we each get to experience our own personal “realities”. Some aspects of that “reality” is generated by electrochemical systems that we all share, and some people have slight (and not so slight) variations on themes that mean their experiential world is very different from the majority in one or more aspects (many well documented cases in the psychological and neurological literature). Under normal circumstances the predictive model is kept entrained to actual reality via our sensory systems, but it can become disconnected via a quite large variety of mechanisms leading to all sorts of “experiences”.
Most of us have the ability to experience “time” in several different modes. Under extreme stress, time can seem to dilate, as the “clock rate” on the update of our experiential reality can increase substantially. It achieves that by reducing the amount of information processed. So under stress we can perceive only that which is directly experienced as important threat or opportunity – everything else is eliminated by subconscious systems, so that the normal refresh rate of about 14 cycles per second can increase to over 200 cycles per second. If you have ever been the driver in a motor-vehicle accident, or similar life threatening emergency, then you may have experienced this.
This makes very good sense in evolutionary terms, as once a threat has been identified it makes good sense to put all possible resources into avoiding it, even at the cost of filtering out a lot of things we might normally consider valuable. So this aspect is much older than humans – older even than mammals I suspect (though I haven’t seen any papers referring to that, only going by my years of observing fish and reptiles and birds – I have trained wild fish to come meet me at the same time and place every day by feeding them regularly).
Many different chemicals can affect our perception of time.
The subject of experience is one that has fascinated me for almost 60 years, since I first noticed it as something other than simply being.