This clock was apparently inside his secret study. When he felt mentally cornered and wanted to think up a brilliant plan, he would activate that device and use the tension of the approaching midnight to bring some flash of inspiration to him.