Clocks were invented roughly 5000 years ago, around 3000 BC. Clocks from this era are called sundials and have undergone many transformations throughout the years to become modern day time-keeping machines.
Sundials in ancient Babylon were very large, and it was not until the Egyptians began developing them further that they became portable. As time keeping evolved, there were smaller sundials as well as hour glasses, water mechanism clocks and pendulums, all of which utilized gravity. In 1511, a German inventor named Peter Henlein created the first spring based clock. Though his clock was imperfect, it inspired many aspiring clock makers to create more accurate clocks, which eventually rendered the near perfect time-keeping devices that we have today.