We study the estimation of the mean function of a continuous-time stochastic process andits derivatives. The covariance function of the process is assumed to be nonparametric andto satisfy mild smoothness conditions. Assuming that n independent realizationsof the process are observed at a sampling design of size N generated by a positivedensity, we derive the asymptotic bias and variance of the local polynomial estimator asn,Nincrease to infinity. We deduce optimal sampling densities, optimal bandwidths, andpropose a new plug-in bandwidth selection method. We establish the asymptotic performanceof the plug-in bandwidth estimator and we compare, in a simulation study, its performancefor finite sizes n,N to the cross-validation and the optimalbandwidths. A software implementation of the plug-in method is available in the Renvironment.