Circadian clock proteins measure out the 24 hour circadian rhythm. In cyanobacteria protein KaiA stimulates KaiC which adds phosphate groups to itself. Then KaiC binds to KaiB which inactivates KaiA and causes the number of phosphate groups on KaiC to drop slowly. KaiB disconnects allowing KaiA to start the cycle again. For details of KaiC see Circadian Clock Protein KaiC.