<?php
require_once __DIR__.'/scripts/__init_script__.php';
$console = PhutilConsole::getConsole();
$iterations = 10;
$source = Filesystem::readFile(__DIR__.'/../phabricator/src/__phutil_library_map__.php');
$start = microtime(true);
for ($ii = 0; $ii < $iterations; $ii++) {
XHPASTTree::newFromData($source);
}
$end = microtime(true);
$duration = $end - $start;
$console->writeOut("Average: %fs\n", $duration / $iterations);
$console->writeOut("Total: %fs\n", $duration);