In the following example the showTime() function is called repeatedly after every 1000 milliseconds (i.e. 1 second) until you tell it to stop.
In the example above the showImage() function is called every time after 2000 milliseconds (i.e. 2 seconds) once the image fade in and fade out transition has been fully completed.