In the ancient times, I wonder if the intelligent people were just curious about the sun's shadows and what they told about how time passes. I'm not sure they really cared about what time it was. They probably didn't have a real tight schedule!
Then a little farther along in history, the sundials became a little more complicated and accurate when people needed to get somewhere at a particular time.
Even in recent times, the sundial was used. It was very accurate and it didn't break down like clocks. They were really used for a long,long time.