The time period of oscillation of a simple pendulum is given by the relation
where g is the acceleration due to gravity and L is the length of the pendulum.
At a given place, since g is constant, the time period of a pendulum of given length is constant. This is why a pendulum can be used to measure the time.