Implementing a timer interrupt

I am on Arduino 1.8.1

I am trying to drive a speaker to beep on dash, unfortunately tone and noTone do not seem to compile. Alternative would be to use a timer interrupt to drive the logic, however there is no documentation on if that can be implemented as seen in:

Tried implementing in the main loop however given other things I am doing the beep is jittery.

Has someone worked on something like this before. How do I proceed.