Do you know how much time has passed since you started reading this mystery?

The world's most precise clocks run at a steady pace, messing up by only about 1 second every 300 million years.

But the brain takes those rhythmic seconds and makes its own sense of time — stretching the ticks and scrunching the tocks. But why can't the brain keep time like a regular clock? In other words, why does time fly when you're having fun, and why does it plod along when you're bored?

How the brain percieves time depends on its expectations. The brain can represent the probability that something is going to occur, given that it hasn't happened yet, said Dr. Michael Shadlen, a neuroscientist at Columbia University Irving Medical Center in New York City. [10 Things We Learned About the Brain in 2018]

Every thought has various "horizons," Shadlen told Live Science. In a book, for example, horizons lie at the end of every syllable, the end of every word, the end of the next sentence and so on. Time moves according to how we anticipate these horizons, he said.

When you're really engrossed in something, the brain anticipates the "big picture" and sees both the near and the distant horizons, which makes time seem to flutter by, Shadlen said. But when you're bored, you anticipate the closer horizons such as the end of a sentence instead of the end of the story; these horizons aren't knit together as a whole, and time crawls.

There isn't a single spot in the brain that's responsible for how we perceive time in this way. Rather, any area that gives rise to thought and consciousness is likely involved in this task, Shadlen said.

"There are almost certainly a multitude of timing mechanisms in the brain," added Joe Paton, a neuroscientist at the Champalimaud Foundation, a private biomedical research foundation in Portugal. (These subjective timing mechanisms have nothing to do with circadian rhythms, or how our body is linked to the 24-hour rotation of our planet.)

One mechanism involves the speed at which brain cells activate one another and form a network when you're performing an activity. The faster those paths of neurons form, the faster we perceive time, Paton and his team have found in rodents.

Another mechanism involves chemicals in the brain. Again, in rodents, Paton and his colleagues found that a set of neurons that releases the neurotransmitter dopamine — an important chemical involved in feeling rewarded — impacts how the brain perceives time. When you're having fun, these cells are more active, they release a lot of dopamine and your brain judges that less time has passed than actually has. When you're not having fun, these cells don't release as much dopamine, and time seems to slow down.

It's not clear why our brains aren't methodically accurate when tracking time. But it could have an evolutionary advantage, Paton said. "Life is kind of a series of should-I-stay-or-should-I-go decisions," Paton told Live Science. This internal sense of time can help animals decide when it's rewarding to stay somewhere.

But when you look back in time, the perceived duration of an event involves the way the brain laid down the memory, said Dr. David Eagleman, an adjunct professor of psychology and public mental health and population sciences at Stanford University. The networks of neurons that code for a new memory are denser than they are for something that's not novel, he said. When you look back, those denser networks make it seem as though that memory lasted longer.

For example, if you were to recall a long flight, but you always take long flights, you might remember it going by more quickly than it seemed at the time because your brain didn't lay down much memory, he said.

Moreover, "time seems to speed up as you get older," Eagleman told Live Science. When you're a child, everything seems novel, and thus your brain lays down dense networks to remember those events and experiences. As an adult, however, you've seen much more, so these events don't prompt the creation of such memories. So, you look back at your younger years and say, "Where did that time go?"

Originally published on Live Science.