Though sun dials and waterclocks were developed to a high level of sophistication, they were inevitably subject to factors in their surrounding environment which could not be predicted or controlled. A sun dial can only be used when the sun is visible.
This eventually led in the middle ages, c.1275, to the development of fully mechanical clocks, like the clock designed by Richard of Wallingford for the abbey of St Albans. These clocks were weight driven. They relied directly on gravity for their motive power, and a stop-start mechanism, called an escapement, to control the speed at which the weight unwound.
In the 17th century the introduction of the pendulum, again exploiting the force of gravity, greatly improved the accuracy of mechanical clocks. The unwinding of a coiled spring, though less accurate, was often used as a substitute in portable time keepers and later, in the twentieth century, electro-mechanical clocks were developed.
It is only in the last fifty years that mechanical and electro-mechanical timekeeping has been superseded by electronic timekeeping.