1 <?php 2 3 include __DIR__ . '/../vendor/autoload.php'; 4 5 if ($argc < 4) { 6 echo "sabre/vobject ", Sabre\VObject\Version::VERSION, " RRULE benchmark\n"; 7 echo "\n"; 8 echo "This script can be used to measure the speed of the 'recurrence expansion'\n"; 9 echo "system."; 10 echo "\n"; 11 echo "Usage: " . $argv[0] . " inputfile.ics startdate enddate\n"; 12 die(); 13 } 14 15 list(, $inputFile, $startDate, $endDate) = $argv; 16 17 $bench = new Hoa\Bench\Bench(); 18 $bench->parse->start(); 19 20 echo "Parsing.\n"; 21 $vobj = Sabre\VObject\Reader::read(fopen($inputFile,'r')); 22 23 $bench->parse->stop(); 24 25 echo "Expanding.\n"; 26 $bench->expand->start(); 27 28 $vobj->expand(new DateTime($startDate), new DateTime($endDate)); 29 30 $bench->expand->stop(); 31 32 echo $bench,"\n"; 33