Bayesian sense of time in biological and artificial brains