A sundial is a device for telling the time. It has a sticking up part called a gnomon which casts a shadow. The gnomon is set on a flat surface on which twelve hours of the day are marked. You can tell the time by looking where the shadow strikes the hour marks.
The first sundials were called shadow clocks. They were used by the Babylonians 3,000 years ago. A shadow clock is made by placing an upright stick in the ground and marking the place where the shadow falls with a stone. Every hour the position of the shadow is noted and marked with a stone. A semicircle of stones may be set up to mark each hour of sunlight and used every day to measure the passing of time.
The length of the shadow as well as the direction also changes with time. The Egyptians used this fact to measure time with a sunbar. This instrument was made from a long piece of wood which had a block of wood on one end. When the sunbar was held towards the Sun the length of the block's shadow could be measured on the long piece of wood to record the passing of the hours.