  This paper investigates the late-time behaviour of certain cosmological
models where oscillations play an essential role. Rigorous results are proved
on the asymptotics of homogeneous and isotropic spacetimes with a linear
massive scalar field as source. Various generalizations are obtained for
nonlinear massive scalar fields, $k$-essence models and $f(R)$ gravity. The
effect of adding ordinary matter is discussed as is the case of nonlinear
scalar fields whose potential has a degenerate zero.
