1. Go to this page and download the library: Download webandco/neos-dev-tools library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$s = new Stopwatch();
...
$nodes = ....
$nodeCount = count($nodes);
$s->restart('nodes');
foreach($nodes as $node){
$c = $stopwatch->countLaps('nodes');
if($c % 10 == 0){ // print ETA on every 10'th node
$this->systemLogger->debug("Duration: ".Stopwatch::format($s->getEvent('nodes')->getDuration())." ETA: ".Stopwatch::format($s->eta('nodes', $nodeCount)));
}
... // process a node
$s->lap('nodes');
}
$s->stop('nodes');
public function processNode(Node $node){
$s = new Stopwatch();
$s->setMetadata('nodeIdentifier', $node->getIdentifier());
$s->setMetadata('nodeType', $node->getNodeType()->getName());
...
$s->restart('ciritical_section');
$s->stop();
// Log the stopwatch, e.g. using wLog($s); - see below
}