more loops

Hi Everybody, I have written a small sketch in the most basic form and I cant get my head around something.

The sketch is a simple watering system and so far I have managed to get it all working, then I decided I wanted to add a routine that only kicked in every 20 cycles.

so what I need to know is how do I get the main part of the program to run 20 times then run another part of the program once, then start again.

so it goes round part one of the program 20 times then goes into part 2, then starts all over again, part one of the program 20 times then goes into part 2

void loop ()
{
  for (int x = 0; x < 20; x++)
  {
    doOneThing ();
  }
  doAnotherThing ();
}

An alternative:

int counter = 0;

void loop()
{
   // do the every time stuff

   counter++;
   if(counter == 20)
   {
       // do the every 20th time stuff

      counter = 0;
   }
}

Thanks Guys, works a treat