Prestellar cores form from the contraction of cold gas and dust material in dark clouds before they collapse to form protostars. Several concurrent theories exist to describe this contraction but they are currently difficult to distinguish. One major difference is the timescale involved in forming the prestellar cores: some theories advocate nearly free-fall speed via, e.g., rapid turbulence decay, while others can accommodate much longer periods to let the gas accumulate via, e.g., ambipolar diffusion. To tell the difference between these theories, measuring the age of prestellar cores could greatly help. However, no reliable clock currently exists. We present a simple chemical clock based on the regulation of the deuteration by the abundance of ortho-H 2 that slowly decays away from the ortho-para statistical ratio of 3 down to or less than 0.001. We use a chemical network fully coupled to a hydrodynamical model that follows the contraction of a cloud, starting from uniform density, and reaches a density profile typical of a prestellar core. We compute the N 2 D + /N 2 H + ratio along the density profile. The disappearance of ortho-H 2 is tied to the duration of the contraction and the N 2 D + /N 2 H + ratio increases in the wake of the ortho-H 2 abundance decrease. By adjusting the time of contraction, we obtain different deuteration profiles that we can compare to the observations. Our model can test fast contractions (from 10 4 to 10 6 cm −3 in ∼0.5 My) and slow contractions (from 10 4 to 10 6 cm −3 in ∼5 My). We have tested the sensitivity of the models to various initial conditions. The slowcontraction deuteration profile is approximately insensitive to these variations, while the fast-contraction deuteration profile shows significant variations. We found that, in all cases, the deuteration profile remains clearly distinguishable whether it comes from the fast collapse or the slow collapse. We also study the para-D 2 H + /ortho-H 2 D + ratio and find that its variation is not monotonic, so it does not discriminate between models. Applying this model to L183 (=L134N), we find that the N 2 D + /N 2 H + ratio would be higher than unity for evolutionary timescales of a few megayears independently of other parameters, such as cosmic ray ionization rate or grain size (within reasonable ranges). A good fit to the observations is only obtained for fast contraction (≤0.7 My from the beginning of the contraction and ≤4 My from the birth of the molecular cloud based on the need to keep a high ortho-H 2 abundance when the contraction starts -ortho-H 2 /para-H 2 ≥ 0.2 -to match the observations). This chemical clock therefore rules out slow contraction in L183 and steady-state chemical models, since steady state is clearly not reached here. This clock should be applied to other cores to help distinguish slow and fast contraction theories over a large sample of cases.