If the second pulse generator 125 determines that the input interval is equal to or larger than the maximum allowable delay time as a result of the process of Step S44 (No in Step S44), the second pulse generator 125 executes the process of Step S52 described later.
If the second pulse generator 125 determines that the input interval is smaller than the maximum allowable delay time as a result of the process of Step S44 (Yes in Step S44), the second pulse generator 125 resets the count value of the first counter, and then calculates the average of the third time in the control cycles up to the previous control cycle (Step S45). The second pulse generator 125 compares the calculated average of the third time (count value corresponding to the third time) with the count value of the second counter, and determines whether or not the actually-measured value in the current time (that is, count value of the second counter) is larger than the average (Step S46).