function show(nc) {
  var s = "";
  var start = Date.now();
  for (i = 0; i < nc; i++) s = s + ".";
  var elapsed = (Date.now() - start) / 1000.0;
  document.write("<tr><td>" + nc + "<td>" + elapsed.toFixed(3));
}

document.write("<table border>");
document.write("<tr><td>Length<td>Seconds");

show(1000);
show(10000);
show(100000);
show(1000000);

document.write("</table>");