When working with the Looping Colors program in our TeenCoder: Game Programming course, you may see a gray screen instead of the the different colors that are supposed to appear every second.

Some computers are unable to support a game loop that has been slowed down to run only once per second (this is unusual for games and is a one-time exercise for this specific activity).  The simple solution is to increase the frequency of the game loop to run 2x or 5x times per second.  This will allow you to see the changing colors at a slightly faster pace.

Just change this line:

    this.TargetElapsedTime = TimeSpan.FromSeconds(1.0f);

To this:

    this.TargetElapsedTime = TimeSpan.FromSeconds(0.5f);  // or 0.2f

This should increase the frequency of the game loop enough for the colors to begin cycling correctly.