ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
rrulebench.php
Go to the documentation of this file.
1<?php
2
3include __DIR__ . '/../vendor/autoload.php';
4
5if ($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
15list(, $inputFile, $startDate, $endDate) = $argv;
16
17$bench = new Hoa\Bench\Bench();
18$bench->parse->start();
19
20echo "Parsing.\n";
21$vobj = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
22
23$bench->parse->stop();
24
25echo "Expanding.\n";
26$bench->expand->start();
27
28$vobj->expand(new DateTime($startDate), new DateTime($endDate));
29
30$bench->expand->stop();
31
32echo $bench,"\n";
An exception for terminatinating execution or to throw for unit testing.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
const VERSION
Full version number.
Definition: Version.php:17
$bench
Definition: rrulebench.php:17
$vobj
Definition: rrulebench.php:21
global $argv
Definition: svg-scanner.php:41