diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-04-25 11:47:18 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-04-25 11:47:18 +0200 |
commit | a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84 (patch) | |
tree | 65d1d73918ccb1d4ccc36184d70af2e8dd91f28e /vendor/sabre/vobject/bin/bench_freebusygenerator.php | |
parent | f1c07977809ce3221286d53e99f0d91145b1166f (diff) | |
download | volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.tar.gz volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.tar.bz2 volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.zip |
update sabre/vobject
Diffstat (limited to 'vendor/sabre/vobject/bin/bench_freebusygenerator.php')
-rw-r--r-- | vendor/sabre/vobject/bin/bench_freebusygenerator.php | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/vendor/sabre/vobject/bin/bench_freebusygenerator.php b/vendor/sabre/vobject/bin/bench_freebusygenerator.php index 2c51b2a32..1299c14fb 100644 --- a/vendor/sabre/vobject/bin/bench_freebusygenerator.php +++ b/vendor/sabre/vobject/bin/bench_freebusygenerator.php @@ -1,16 +1,16 @@ <?php -include __DIR__ . '/../vendor/autoload.php'; +include __DIR__.'/../vendor/autoload.php'; if ($argc < 2) { - echo "sabre/vobject ", Sabre\VObject\Version::VERSION, " freebusy benchmark\n"; + echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " freebusy benchmark\n"; echo "\n"; echo "This script can be used to measure the speed of generating a\n"; echo "free-busy report based on a calendar.\n"; echo "\n"; echo "The process will be repeated 100 times to get accurate stats\n"; echo "\n"; - echo "Usage: " . $argv[0] . " inputfile.ics\n"; + echo 'Usage: '.$argv[0]." inputfile.ics\n"; die(); } @@ -30,33 +30,24 @@ $timeZone = new \DateTimeZone('America/Toronto'); $bench->fb->start(); -for ($i = 0; $i < $repeat; $i++) { - +for ($i = 0; $i < $repeat; ++$i) { $fb = new Sabre\VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone); $results = $fb->getResult(); - } $bench->fb->stop(); - - echo $bench,"\n"; -function formatMemory($input) { - +function formatMemory($input) +{ if (strlen($input) > 6) { - - return round($input / (1024 * 1024)) . 'M'; - + return round($input / (1024 * 1024)).'M'; } elseif (strlen($input) > 3) { - - return round($input / 1024) . 'K'; - + return round($input / 1024).'K'; } - } unset($input, $splitter); -echo "peak memory usage: " . formatMemory(memory_get_peak_usage()), "\n"; -echo "current memory usage: " . formatMemory(memory_get_usage()), "\n"; +echo 'peak memory usage: '.formatMemory(memory_get_peak_usage()), "\n"; +echo 'current memory usage: '.formatMemory(memory_get_usage()), "\n"; |