A printer for performing printing on a sheet member, the printer comprising: detecting sensor configured to detect a leading end of the sheet member as well as an end portion for each of labels of the sheet member; drive roller and pressure roller configured to transfer the sheet member; and control unit configured to obtain a length of one of the labels that is adjacent to the leading end of the sheet member based on results of the detection by the detecting sensor, and to control the drive roller and pressure roller according to a result that has been obtained, characterized in that the control unit is configured to perform: a first step of obtaining a length of the sheet member after the leading end is detected by the detecting sensor until a rear end portion of a first of the labels of the sheet member adjacent to the leading end is detected by the detecting sensor; a second step of obtaining a length of the sheet member after the rear end portion of the first of the labels of the sheet member is detected by the detecting sensor until a rear end portion of a second of the labels of the sheet member is detected by the detecting sensor; and a third step of, when a difference between the length obtained in the first step and the length obtained in the second step is smaller than a predetermined threshold value, starting printing on the first of the labels adjacent to the leading end of the sheet member, and when the difference between the length obtained in the first step and the length obtained in the second step is equal to or greater than the threshold value, starting printing on the second of the labels adjacent to the first of the labels of the sheet member. detecting sensor configured to detect a leading end of the sheet member as well as an end portion for each of labels of the sheet member; drive roller and pressure roller configured to transfer the sheet member; and control unit configured to obtain a length of one of the labels that is adjacent to the leading end of the sheet member based on results of the detection by the detecting sensor, and to control the drive roller and pressure roller according to a result that has been obtained, characterized in that the control unit is configured to perform: a first step of obtaining a length of the sheet member after the leading end is detected by the detecting sensor until a rear end portion of a first of the labels of the sheet member adjacent to the leading end is detected by the detecting sensor; a second step of obtaining a length of the sheet member after the rear end portion of the first of the labels of the sheet member is detected by the detecting sensor until a rear end portion of a second of the labels of the sheet member is detected by the detecting sensor; and a third step of, when a difference between the length obtained in the first step and the length obtained in the second step is smaller than a predetermined threshold value, starting printing on the first of the labels adjacent to the leading end of the sheet member, and when the difference between the length obtained in the first step and the length obtained in the second step is equal to or greater than the threshold value, starting printing on the second of the labels adjacent to the first of the labels of the sheet member. a first step of obtaining a length of the sheet member after the leading end is detected by the detecting sensor until a rear end portion of a first of the labels of the sheet member adjacent to the leading end is detected by the detecting sensor; a second step of obtaining a length of the sheet member after the rear end portion of the first of the labels of the sheet member is detected by the detecting sensor until a rear end portion of a second of the labels of the sheet member is detected by the detecting sensor; and a third step of, when a difference between the length obtained in the first step and the length obtained in the second step is smaller than a predetermined threshold value, starting printing on the first of the labels adjacent to the leading end of the sheet member, and when the difference between the length obtained in the first step and the length obtained in the second step is equal to or greater than the threshold value, starting printing on the second of the labels adjacent to the first of the labels of the sheet member.