Valeo Interview Question

write a c function to measure the frequency of a sinwave