Humans (and some other animals) have a sense of 'rhythm', i.e. the ability to detect and react with 'beats' - normally in musical compositions. Professional drummers can 'beat time' with accuracies of just a few milliseconds per beat 1) This implies that the brain has an internal 'clock' (running at accuracies down to milliseconds) against which a musician can reference his/her motor outputs.
There are two main theories of how this might be happening. One is that the beats can be judged and reacted-to in an 'absolute' way (with reference to the mental clock) - the other is that the beats are judged 'relatively' to the previous beats (involving a 'memory' of the timings).
Experiments and observations of brain damaged patients have located (at least some of) the brain areas where the 'clock' appears to be located.
There is reasonable consensus that the cerebellum is involved in absolute timing mechanisms, and basal ganglia-thalamo-cortical circuits are involved in relative timing mechanisms
But the underlying biological mechanisms which might be able to regulate a 'clock' at such accuracies is completely unknown.
There is also no explanation from an evolutionary standpoint as to why the extremely accurate timing system might have evolved.
Note: Longer periods (minutes, hours, days, weeks etc etc) of humans' time perception, which is also unexplained (and which may or may not be related to the beat perception clock) can be found here : Time Awareness