Other things that may help are pinout/port descriptions. Find the UNO on this
thread. Port D is the only 8 bit wide port available but it includes the UART RX/TX pins so if you want to use it to drive the display then you cannot use the Serial monitor and may need to disconnect these pins to upload a new sketch.
Datatype and function references here
. unsigned short looks to be byte (8 bits). int is signed 16 bit number.
Also be aware the MAX current a pin can sink is 40mA and overall current sink of device is 200mA so check your circuit for driving the 7-segment display.
You look to be using a timer to count pulses so if your still going to do it that way then this
may be helpful in setting up the timer as a counter. Another approach for the UNO would be to use an interrupt
but the hardware interrupt pins also reside on port d.