The mean and the variance of the time S(t) spent by a system below a random threshold until t are obtained when the system level is modelled by the current value of a sequence of independent and identically distributed random variables appearing at the epochs of a nonhomogeneous Poisson process. In the case of the homogeneous Poisson process, the asymptotic distribution of S(t)/t as t → ∞ is derived.