I have a good reason to use Timer/Counter. The other routines of the system are so time sensitive that using interrupts is no answer.
So if you want to avoid interrupts counting pulses as well as polling the pin state, you most likely refer to what is described in the Atmega328 datasheet in chapter "16.3 External Clock Source" for Timer0 and Timer1:
"An external clock source applied to the T1/T0 pin can be used as Timer/Counter clock"
This mode of Timer0/Timer1 is not supported by the Arduino software. The T0 pin is even not available on the Arduino boards. You can use the T1 pin with Atmega328 based boards as a hardware counter, which is labeled "D5" on an Arduino UNO.
As there is no ready-to-use Arduino library function available, you will have to configure and use that by direct pin/port programming. Arduino users hardly use that timer/counter configuration for hardware counting.
So if you are looking for a code example, perhaps not only look for Arduino sources, but search for general AVR/Atmega/GCC code that uses the T1 register with external clock setting for your type of controller. Please keep in mind, that your code will be strictly dependent on hardware and needs changes if you want to run the code on Atmega328, Atmega2560 oder Atmega32U4 controllers. If you know the type of controller, you can start loading the appropriate datasheet for the controller where you can find all information about the configuration settings needed to use a counter/timer with an external clock as a counting source.