A printer having storing means storing time information indicating the time at which cleaning operations were last performed, with the initial value of time information stored in the storing means being set to a time later than the shipment of the printer. Elapsed time between the time information stored in the storing means and the current time is calculated when a user gives the printer an instruction to start printing operations. The printer performs suitable cleaning operation for a case wherein the calculated value of the elapsed time is negative.