From a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 25 Apr 2019 11:47:18 +0200 Subject: update sabre/vobject --- vendor/sabre/vobject/bin/bench_manipulatevcard.php | 39 ++++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'vendor/sabre/vobject/bin/bench_manipulatevcard.php') diff --git a/vendor/sabre/vobject/bin/bench_manipulatevcard.php b/vendor/sabre/vobject/bin/bench_manipulatevcard.php index adc198e9b..f229091db 100644 --- a/vendor/sabre/vobject/bin/bench_manipulatevcard.php +++ b/vendor/sabre/vobject/bin/bench_manipulatevcard.php @@ -1,15 +1,15 @@ parse->start(); $vcard = $splitter->getNext(); $bench->parse->pause(); - if (!$vcard) break; + if (!$vcard) { + break; + } $bench->manipulate->start(); $vcard->{'X-FOO'} = 'Random new value!'; $emails = []; - if (isset($vcard->EMAIL)) foreach ($vcard->EMAIL as $email) { - $emails[] = (string)$email; + if (isset($vcard->EMAIL)) { + foreach ($vcard->EMAIL as $email) { + $emails[] = (string) $email; + } } $bench->manipulate->pause(); @@ -42,28 +45,20 @@ while (true) { $bench->serialize->pause(); $vcard->destroy(); - } - - 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"; -- cgit v1.2.3