In many applications, it is often necessary to sample the mean value of certain quantity with respect to a probability measure µ on the level set of a smooth function ξ :A specially interesting case is the so-called conditional probability measure, which is useful in the study of free energy calculation and model reduction of diffusion processes. By Birkhoff's ergodic theorem, one approach to estimate the mean value is to compute the time average along an infinitely long trajectory of an ergodic diffusion process on the level set whose invariant measure is µ. Motivated by the previous work of Ciccotti, Lelièvre, and Vanden-Eijnden [11], as well as the work of Lelièvre, Rousset, and Stoltz [33], in this paper we construct a family of ergodic diffusion processes on the level set of ξ whose invariant measures coincide with the given one. For the conditional measure, in particular, we show that the corresponding SDEs of the constructed ergodic processes have relatively simple forms, and, moreover, we propose a consistent numerical scheme which samples the conditional measure asymptotically. The numerical scheme doesn't require computing the second derivatives of ξ and the error estimates of its long time sampling efficiency are obtained.