A person appearing before an examiner to be examined, or to produce a document or thing, is entitled to payment of the same amount for expenses and loss of time that the person would have been entitled to on attending to give evidence, or to produce a document or thing, at the trial of the proceeding before the court.