Serial print at a slower rate

Hi,

This is a modified code from the 'Arduino Cookbook' Book - page 186

It currently prints loads to the serial monitor! How could i edit this so it prints one reading a second?

Ive thought about using millis() but i cant think where to implement it!

const int middleValue = 512;         //the middle of the range of analog values
const int numberOfSamples = 128;     //how many readings will be taken each time

int sample;                 //the value read from the microphone each time
long signal;                //the reading once you have removed the DC offset
long averageReading;        //the average of that loop of readings

long runningAverage = 0;         //the running average of calculated values
const int averagedOver = 16;     //how quickly new values affect running average 
                                 //bigger numbers mean slower

void setup() 
{
Serial.begin(9600);
}

void loop() {

long sumOfSquares = 0;
for (int i=0; i<numberOfSamples; i++) {   //take many readings and average them
   sample = analogRead(0);                //take a reading
   signal = (sample - middleValue);       //work out its offset from center
   signal *= signal;                      //square it to make all the values positive
   sumOfSquares += signal;                //add to the total
}
averageReading = sumOfSquares/numberOfSamples;    //calculate running average
runningAverage=(((averagedOver-1)*runningAverage)+averageReading)/averagedOver;
 
 Serial.println(runningAverage);

}

The simple answer is to use delay(1000); after the print line.
delay() however, freezes the controller for this period of time, not letting anything else to execute.
Might be time to look at the Blink Without Delay example in the IDE.

Suppose the time frame was one hour, instead. How would YOU do something once an hour, if the first time you did it was 11:37:28?