I recall seeing a movie in the 1980’s about a dark city set in some futuristic setting where people were being coerced into becoming addicted to a drug that altered their sense of reality and at the end the scene panned out to show that the world they lived in was either a clock or a part in a clock. I think the lead was someone who looked like Tom Waits.