$\def\v#1{\mathbf{v}_{#1}}$ For an ensemble of $n$ photons (think: photons-in-a-mirror-box) with velocities $\v{i}$ (3-dimensional), where $|\v{i}|=c$, we have
$$c\frac{d\tau}{dt} = \sigma(\v{1},\dots,\v{n}),$$
where $\tau$ is the local time of the ensemble of photons and $\sigma$ is the standard deviation. Looks like time is nothing but a measure of messiness :-)