Valeo Interview Question

how to get duty cycle for input signal on microcontroller