Uplaod a code in arduino 1mhz

Hi my arduino is working on default clock speed how can i make a speed of 1MHZ for my code.

(deleted)

const float freq = 16000000 / 2;

will this work...? above the code

No. To set the Arduino clock to 1 MHz, set the fuses to use the 8 MHz INTRC oscillator, set the CLKDIV8 fuse, and make sure to use the correct board definition in the Arduino IDE.