pulseIn() function problem for measure frequency

You period is ~10mS that's 10,000 so there's a problem with the 8117 number somewhere.

how long is the rising time of a square wave with 50 HZ

At this level "rise times" do not enter into it. How are you generating this square wave? I suspect it has something to do with that.

What happens if you measure the LOW half of the waveform, do the two numbers add up to 20,000?


Rob