A photoelectric sensor comprising: a light-projecting unit adapted to project light; a light-receiving unit adapted to receive light projected from the light-projecting unit and to generate data on an amount of received light in real time; an output unit adapted to output a detection signal indicating that a detection target has been detected; a signal processing unit adapted to receive the data on the amount of received light generated by the light-receiving unit, to perform a measuring process for the data on the amount of received light, to compare the measurement data obtained by the measuring process with a predetermined threshold to determine whether a detection target is present or not, and to switch between ON and OFF states of the detection signal according to a result of the determination, wherein the signal processing unit includes: storage means adapted to store the data on the amount of received light input from the light-receiving unit within a fixed period of time, the signal processing unit being adapted to specify, from among the data on the amount of received light stored in the storage means, a specified data group indicating a change in the amount of received light, which change takes place during the passage of one detection target; sampling means adapted to perform a sampling process in which the specified data group stored in the storage means is read as sampling data at fixed intervals, the sampling process being performed during a limited reading period corresponding to data including said specified data group; a display unit for digitally displaying values of the sampling data; and output means adapted to output the sampling data, read by the sampling means, in association with order in which the sampling data are stored in the storage means, wherein the output means is configured to serve as means for displaying, on the display unit, the sampling data to be output in the order in which they are read from the storage means, wherein the output means is configured such that the sampling data to be output are displayed on the display unit in order and over a time exceeding a time required for the data to be stored in the storage means. a light-projecting unit adapted to project light; a light-receiving unit adapted to receive light projected from the light-projecting unit and to generate data on an amount of received light in real time; an output unit adapted to output a detection signal indicating that a detection target has been detected; a signal processing unit adapted to receive the data on the amount of received light generated by the light-receiving unit, to perform a measuring process for the data on the amount of received light, to compare the measurement data obtained by the measuring process with a predetermined threshold to determine whether a detection target is present or not, and to switch between ON and OFF states of the detection signal according to a result of the determination, wherein the signal processing unit includes: storage means adapted to store the data on the amount of received light input from the light-receiving unit within a fixed period of time, the signal processing unit being adapted to specify, from among the data on the amount of received light stored in the storage means, a specified data group indicating a change in the amount of received light, which change takes place during the passage of one detection target; sampling means adapted to perform a sampling process in which the specified data group stored in the storage means is read as sampling data at fixed intervals, the sampling process being performed during a limited reading period corresponding to data including said specified data group; a display unit for digitally displaying values of the sampling data; and output means adapted to output the sampling data, read by the sampling means, in association with order in which the sampling data are stored in the storage means, wherein the output means is configured to serve as means for displaying, on the display unit, the sampling data to be output in the order in which they are read from the storage means, wherein the output means is configured such that the sampling data to be output are displayed on the display unit in order and over a time exceeding a time required for the data to be stored in the storage means. storage means adapted to store the data on the amount of received light input from the light-receiving unit within a fixed period of time, the signal processing unit being adapted to specify, from among the data on the amount of received light stored in the storage means, a specified data group indicating a change in the amount of received light, which change takes place during the passage of one detection target; sampling means adapted to perform a sampling process in which the specified data group stored in the storage means is read as sampling data at fixed intervals, the sampling process being performed during a limited reading period corresponding to data including said specified data group; a display unit for digitally displaying values of the sampling data; and output means adapted to output the sampling data, read by the sampling means, in association with order in which the sampling data are stored in the storage means, wherein the output means is configured to serve as means for displaying, on the display unit, the sampling data to be output in the order in which they are read from the storage means, wherein the output means is configured such that the sampling data to be output are displayed on the display unit in order and over a time exceeding a time required for the data to be stored in the storage means.