What is the mechanism behind time perception? I wonder if it's known how time perception works at the fundamental level.

For example, to count accurately a minute/hour, do we have to keep track of the time passed counting in our minds or observing our enviroment? In the same way we can't know how much distance we've really travelled if there is no reference frame, if we were totally isolated, would we measure time accurately?

Or we could have some internal clock which helps us to measure time. I think that one problem to test this is that things like hunger, sleep, etc. could also work as clocks, so we can't be totally isolated.

For example, Richard Feynman though that every person could count a minute with some error, but the error will always be the same.
There are several mechanisms for time perception that depend on the task performed (counting, judging prospectively, retrospectively) as well as on the duration of the interval to be judged (duration perception for 1s intervals works differently from 1minute or 1 year). Overall the idea you advance of multiple mechanisms is well accepted. This is just a link to an article just published on the matter.  

http://www.scientificamerican.com/article.cfm?id=your-brain-has-two-clocks&amp;utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+sciam%2Fpsychology+%28Topic%3A+Psychology%29

Perhaps if you could be more precise in your question and restrict your domain it will be much easier to answer about the neural foundations you are looking for