var path=require("path"),fs=require("fs");var less=require("../lib/less");var file=path.join(__dirname,"benchmark.less");if(process.argv[2]){file=path.join(process.cwd(),process.argv[2])}fs.readFile(file,"utf8",function(g,f){var a,c,h,b,d;console.log("Benchmarking...\n",path.basename(file)+" ("+parseInt(f.length/1024)+" KB)","");h=new (Date);new (less.Parser)({optimization:2}).parse(f,function(i,e){b=new Date();d=b-h;console.log("Parsing: "+d+" ms ("+Number(1000/d*f.length/1024)+" KB/s)");h=new Date();c=e.toCSS();b=new Date();console.log("Generation: "+(b-h)+" ms ("+parseInt(1000/(b-h)*f.length/1024)+" KB/s)");d+=b-h;console.log("Total: "+d+"ms ("+Number(1000/d*f.length/1024)+" KB/s)");if(i){less.writeError(i);process.exit(3)}})});