bench.php
1 year ago
bench_freebusygenerator.php
1 year ago
bench_manipulatevcard.php
1 year ago
fetch_windows_zones.php
1 year ago
generate_vcards
1 year ago
generateicalendardata.php
1 year ago
mergeduplicates.php
1 year ago
rrulebench.php
1 year ago
vobject
1 year ago
rrulebench.php
33 lines
| 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 | exit(); |
| 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 |