comsat:
... but no luck.
Be more specific. What were your results? Did you continue to measure about 50 Hz? Did you fail to get a reading at all?
... or is it possible because i connect wrong pin?
I can't see your connections. If you connected to the wrong pin, that would be an explanation. Maybe you're asking if pin 8 is the correct pin for this program to use - I'll suggest that you review the site you referenced in your original post - FreqMeasure Library, for Measuring Frequencies in the 0.1 to 1000 Hz range, or RPM Tachometer Applications - which states that pin 8 is the pin to use for the Arduino Uno. If you're not using an Uno, maybe you are indeed connected to the wrong pin. Which Arduino are you using?
... i looked the code again and there is no mention about pin 8 as an input.
There's no mention of any pin as an input. INPUT is the default state of the pins, so it's generally not necessary to explicitly set the mode to INPUT.
I don't see that you've answered the question about the power frequency at your location. Is it 50 Hz?