private void reportStats()
	  /* The statistics:
	       - the summed periods for all the iterations in this interval
	         (period is the amount of time a single frame iteration should take), 
	         the actual elapsed time in this interval, 
	         the error between these two numbers;

	       - the total number of calls to paintComponent();

	       - the FPS (frames/sec) for this interval, and the average 
	         FPS over the last NUM_FPSs intervals.

	     The data is collected every MAX_STATS_INTERVAL  (1 sec).
	  */
	  { 
	    frameCount++;
	    statsInterval += period;

	    if (statsInterval >= MAX_STATS_INTERVAL) {     // record stats every MAX_STATS_INTERVAL
	      long timeNow = System.nanoTime();

	      long realElapsedTime = timeNow - prevStatsTime;   // time since last stats collection
	      totalElapsedTime += realElapsedTime;

	      long sInterval = (long)statsInterval*1000000L;  // ms --> ns
	      double timingError = 
	          ((double)(realElapsedTime - sInterval)) / sInterval * 100.0;

	      double actualFPS = 0;     // calculate the latest FPS
	      if (totalElapsedTime > 0)
	        actualFPS = (((double)frameCount / totalElapsedTime) * 1000000000L);

	      // store the latest FPS
	      fpsStore[ (int)statsCount%NUM_FPS ] = actualFPS;
	      statsCount = statsCount+1;

	      double totalFPS = 0.0;     // total the stored FPSs
	      for (int i=0; i < NUM_FPS; i++)
	        totalFPS += fpsStore[i];

	      if (statsCount < NUM_FPS)  // obtain the average FPS
	        averageFPS = totalFPS/statsCount;
	      else
	        averageFPS = totalFPS/NUM_FPS;

	      System.out.println(timedf.format( (double) statsInterval/1000) + " " + 
	                        timedf.format((double) realElapsedTime/1000000000L) + "s " + 
							df.format(timingError) + "% " + 
	                        frameCount + "c " +
	                        df.format(actualFPS) + " " +
	                        df.format(averageFPS) + " afps" );

	      prevStatsTime = timeNow;
	      statsInterval = 0L;   // reset
	    }
	  }  // end of reportStats()