Use case: Live images are provided in real time and are to be viewed on the screen. To lower the CPU load, the user should be able to discard images and only show, say 10%, or 50%, of the images.

If the user choose 50%, then every other image should be shown (not 50 images in a row, and then discard 50, as that would be 50% too..)

The current code:

```
void paintImage(int everyWhatImage)
{
    showImage();
}

```

shows the image 100% of the times.

If the user supply an integer, like 1,2,3 .., meaning every one, every second, every third and so on, something familiar like this could be used:

```
void paintImage(int everyWhatImage)
{   
  if(counter % everyWhatImage)
  {
     showImage();
  }
  counter++;
}

```

However, the above algorithm don't support showing less than 50% (the '2') of the images, and so the question is, how to do that?

As this is a live streaming application, it needs to be fast.

In addition, the above code is executed in a *callback function*, so there is no knowledge of when it is to be executed.