32 lines
925B

  1. <?php
  2. require(__DIR__ . '/../Parser.php');
  3. require(__DIR__ . '/../Markdown.php');
  4. $markdown = '';
  5. $markdown = file_get_contents(__DIR__ . '/markdown-data/specs.md');
  6. //$markdown = file_get_contents(__DIR__ . '/github-data/github-sample.md');
  7. //ini_set('xhprof.output_dir', __DIR__ . '/xhprof');
  8. // http://de3.php.net/manual/en/xhprof.examples.php
  9. xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
  10. for ($n = 0; $n < 100; $n++) {
  11. $pd = new \cebe\markdown\Markdown();
  12. $pd->parse($markdown);
  13. }
  14. $xhprof_data = xhprof_disable();
  15. $XHPROF_ROOT = __DIR__ . '/../vendor/facebook/xhprof/';
  16. include_once $XHPROF_ROOT . '/xhprof_lib/utils/xhprof_lib.php';
  17. include_once $XHPROF_ROOT . '/xhprof_lib/utils/xhprof_runs.php';
  18. $xhprof_runs = new XHProfRuns_Default();
  19. $run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_testing");
  20. echo "http://localhost/xhprof/xhprof_html/index.php?run={$run_id}&source=xhprof_testing\n";