old_contents: #!/usr/bin/env node
  
  process.stdin.setEncoding("utf8");
  
  var fs      = require("fs"),
      fname   = process.argv[2] || "example",
      transit = require("../target/transit.js"),
      r       = transit.reader(),
      jstr    = fs.readFileSync("resources/"+fname+".json", "utf-8");
      tstr    = fs.readFileSync("resources/"+fname+".tjs", "utf-8");
  
  function time(f, iters) {
      iters = iters || 1;
      for(var i = 0; i < iters; i++) {
          var s = new Date();
          f();
          console.log("Elapsed "+((new Date()).valueOf()-s.valueOf())+"ms");
          console.log("----------");
      }
  }
  
  console.log("JSON.parse 100 iters", JSON.parse(jstr).length);
  time(function() {
      for(var i = 0; i < 100; i++) {
          JSON.parse(jstr);
      }
  }, 5);
  
  console.log("JSON.parse transit JSON 100 iters", JSON.parse(tstr).length);
  time(function() {
      for(var i = 0; i < 100; i++) {
          JSON.parse(tstr);
      }
  }, 5);
  
  console.log("transit read 100 iters", r.read(tstr).length);
  time(function() {
      for(var i = 0; i < 100; i++) {
          r.read(tstr);
      }
  }, 5);
  
new_contents: #!/usr/bin/env node
  
  process.stdin.setEncoding("utf8");
  
  var fs      = require("fs"),
      fname   = process.argv[2] || "example",
      iter    = process.argv[3] ? parseInt(process.argv[3], 10) : 100,
      transit = require("../target/transit.js"),
      r       = transit.reader(),
      jstr    = fs.readFileSync("resources/"+fname+".json", "utf-8");
      tstr    = fs.readFileSync("resources/"+fname+".tjs", "utf-8");
  
  function time(f, iters) {
      iters = iters || 1;
      for(var i = 0; i < iters; i++) {
          var s = new Date();
          f();
          console.log("Elapsed "+((new Date()).valueOf()-s.valueOf())+"ms");
          console.log("----------");
      }
  }
  
  console.log("JSON.parse "+iter+" iters");
  time(function() {
      for(var i = 0; i < iter; i++) {
          JSON.parse(jstr);
      }
  }, 5);
  
  console.log("JSON.parse transit JSON "+iter+" iters");
  time(function() {
      for(var i = 0; i < iter; i++) {
          JSON.parse(tstr);
      }
  }, 5);
  
  console.log("transit read "+iter+" iters");
  time(function() {
      for(var i = 0; i < iter; i++) {
          r.read(tstr);
      }
  }, 5);
  
subject: allow supplying iter to bench/json.js