How do you measure the duty cycle of sinus with a arduino uno?

A buzzer will produce a complex waveform with a lot of harmonics in it , which will make it difficult to measure
unless you filter out all the harmonics and just leave the fundamental, which will be a sine wave and easy to measure.