How change rgb color of background per second?

how can I change the color of the background, so that every second there is a different color?
The background is simply a single rgb color.

(i use 0.8.4. version)

Thanks!

if(ofGetElapsedTimef() - myTimer >= 1.0){
myTimer = ofGetElapsedTimef();
newR = ofRandom(255);
newG = ofRandom(255);
newB = ofRandom(255);
}

ofSetColor(newR,newG,newB);
ofDrawRectangle(0,0,ofGetWidth(),ofGetHeight());

Thanks, Stephan!