Ultrasonic Sensor scanning too often resulting in a whirring noise
If you want to sample at 4Hz (4 times per second), you need to change your headers accordingly:

const int serialPeriod = 250;       // only print to the serial console every 1/4 second
unsigned long timeSerialDelay = 0;

const int loopPeriod = 250;          // a period of 250ms = a frequency of 4Hz
unsigned long timeLoopDelay   = 0;