Added time option for sample method.