Measure PWM Duty Cycle on a Specific PIN (Arduino Mega )

I have followed few posts, but I understood it by default reads the PWM signal from PIN 2.

What is "it"? If you have code, post it. Where us the PWM signal coming from?

Please read the "How to use this forum-please read" stickies to see how to post code and some hints on what we need to know in order to help you. See #7 & 11, especially.