
// DrawRandoms.java
// Andrew Davison, ad@coe.psu.ac.th, October 2020

/* Draws 10,000 random dots on the XY panel, and reports
   on the execution time. It takes about 7 seconds, mostly
   due to rendering time.

   Usage:
      >  compile DrawRandoms.java
      >  run DrawRandoms
*/

import java.util.*;


public class DrawRandoms
{
  public static void main(String[] args)
  {
    long startTime = System.currentTimeMillis();

    Random r = new Random(); 
    for (int i=0; i < 10000; i++)
      StdDraw.point( r.nextDouble(), r.nextDouble());

    System.out.printf("Execution time: %.2f secs\n",
       (System.currentTimeMillis() - startTime)/1000.0);
  }  // end of main()

}  // end of DrawRandoms class
