First thing I thought of once I started reading this was Neil Stephenson's 'Anathem.' In it there is a monastery of sorts with gates separating different areas. There are gates that open once a year, once every ten years, once every 100 years, and once every 1000 years. There is also a giant clock in the center of the monastery that is wound daily by four individuals.