Pulse counter code

how we can write a pulse counter code in Arduino ?

I am working in a project that takes the analog signal from comparator then sends the signal to the Arduino to count the pulse.

Looks like you already found that in your other post, here: What is the function of this code