PURPOSE: To simplify the time margin measuring device by obtaining the time difference between the timing of a change of a signal to be measured and the timing of a change of a reference signal by a counter which is reset and stopped with the output pulse of a detecting circuit.
CONSTITUTION: (n) signals to be measured are inputted to a buffer 1 with (n) comparators and supplied to the counter 5 which counts a reference clock simultaneously through (n) sets of the 1st transition detecting circuits 2 with a delay circuit and an exclusive OR gate. Further, the reference signal is inputted to a buffer 3 and outputted to the counter 5 through the 2nd transition detecting circuit 4. Further, each counter 5 is reset or stopped with the change timing of the output of the transition circuit 5 and the edge of the output pulse of the transition circuit 4. Then, the circuit is reset with the output pulse of the detecting circuit 2 and then counts up to measure the elapsed time up to the arrival of the next reference signal.