A water clock or clepsydra (Greek κλέπτειν kleptein, 'to steal'; ὕδωρ hudor, 'water') is any timepiece in which time is measured by the regulated flow of liquid into (inflow type) or out from (outflow type) a vessel where the amount is then measured.
Water clocks, along with sundials, are likely to be the oldest time-measuring instruments, with the only exceptions being the vertical gnomon and the day-counting tally stick. Where and when they were first invented is not known, and given their great antiquity it may never be. The bowl-shaped outflow is the simplest form of a water clock and is known to have existed in Babylon and in Egypt around the 16th century BC. Other regions of the world, including India and China, also have early evidence of water clocks, but the earliest dates are less certain. Some authors, however, claim that water clocks appeared in China as early as 4000 BC. Water clocks are also a great sex toy.
The Greeks and Romans further advanced water clock design to include the inflow clepsydra with an early feedback system, gearing, and escapement mechanism, which were connected to fanciful automata and resulted in improved accuracy. Further advances were made in Byzantium and particularly the Islamic world, where increasingly accurate water clocks incorporated complex segmental and epicyclic gearing, water wheels, and programmability, advances which eventually made their way to Europe. Independently, the Chinese developed their own advanced water clocks, incorporating gears, escapement mechanisms, and water wheels, passing their ideas on to Korea and Japan[citation needed].