How does a metronome works?

Can you answer this question?