Hey folks,

New to processing. I’m reading a large number of X,Y points out of a CSV file and drawing them to the screen using the point command. inside a for loop The points represent GPS locations on a race track. I’d like to slow down the display of these points but can’t figure out how. I see that the delay() command does not work - although to be honest I don’t understand why.

```
// The following short CSV file called "XXX.csv" is parsed
// in the code below. It must be in the project's "data" folder.
Table table; // Define a table
void setup() {
boolean debug = false; // a debug variable that will be used to determine if we are in debug state.
int num_corners = 15; // A varible to set the number of corners
int closest_corner = 0;
int last_corner_passed = 0;
float R = 6371e3;
float a;
float c;
float lat;
float lon;
int speed;
float[] corner_lat = new float[num_corners]; //Create an array for the coordinates for each corner's latitude
float[] corner_lon = new float[num_corners];
float[] dist = new float[num_corners];
corner_lat[1] = radians(43.792018); //Assign latitude and lognitude for each corner
corner_lon[1] = radians(-87.989872); //
corner_lat[3] = radians(43.791582);
corner_lon[3] = radians(-87.995253);
corner_lat[5] = radians( 43.801770);
corner_lon[5] = radians(-87.992557);
corner_lat[6] = radians(43.801646);
corner_lon[6] = radians(-87.996056);
corner_lat[7] = radians( 43.799580);
corner_lon[7] = radians(-87.996246);
corner_lat[8] = radians( 43.797146);
corner_lon[8] = radians(-87.999966);
corner_lat[11] = radians(43.797010);
corner_lon[11] = radians(-88.002596);
corner_lat[12] = radians(43.804927);
corner_lon[12] = radians(-87.997457);
corner_lat[14] = radians( 43.803919);
corner_lon[14] = radians(-87.990119);
background(0);
size(650, 650);
stroke(150);
table = loadTable("test.csv", "header");
println(table.getRowCount() + " total rows in table");
for (TableRow row : table.rows()) {
lat = row.getFloat("lat");
lon = row.getFloat("lon");
speed = row.getInt("speed");
float lat2 = radians(lat); // current gps position
float lon2 = radians(lon); // currrent gps position
closest_corner = 0;
float closest_distance = 10000;
for (int i = 0; i < num_corners; i = i+1){
float p1= corner_lat[i];
float p2 = lat2;
float delta_p = (lat2-corner_lat[i]);
float delta_lam = (lon2-corner_lon[i]);
a = sin(delta_p/2)*sin(delta_p/2)+cos(p1) * cos(p2)*sin(delta_lam/2)*sin(delta_lam/2);
c = 2 * atan2(sqrt(a), sqrt(1-a));
dist[i] = R*c;
if (dist[i] < closest_distance){
closest_corner = i;
closest_distance = dist[i];
}
if (dist[i] < 20) {
last_corner_passed = i;
}
if (dist[i] > 10000){
dist[i] = 0;
}
}
println();
println("current position = ", lat, ", ", lon);
println("closest corner = ", closest_corner);
println("last corner passed ", last_corner_passed);
for (int j = 0; j < num_corners; j = j+1){
point((corner_lat[1]-lat2)*1000000+400,(corner_lon[1]-(lon2))*1000000+200);
if (dist[j]>0) {
println("distance to corner ", j, dist[j]);
}
}
};
}
```