A non-transitory recording medium storing a program that, when executed by a computer, causes a processor to implement a method of controlling an image forming apparatus that forms and outputs an image on a recording sheet,
- the method of controlling the image forming apparatus comprising the steps of:
- generating a detection signal indicating a position of an axially displaceable roller of the image forming apparatus;
- acquiring multiple detection signals indicating the position of the axially displaceable roller in chronological order;
- calculating recording sheet thickness based on the multiple detection signals acquired in chronological order;
- and
- detecting vibration of the image forming apparatus based on the multiple detection signals acquired in chronological order.