1
0
mirror of synced 2025-01-09 10:47:08 +03:00
DeliveryModuleBundle/Service/PinbaService.php

26 lines
565 B
PHP
Raw Normal View History

2019-12-26 17:47:33 +03:00
<?php
namespace RetailCrm\DeliveryModuleBundle\Service;
class PinbaService
{
/**
* @param array $tags
* @param \Closure $handler
*
* @return mixed
*/
public function timerHandler(array $tags, \Closure $handler)
{
2020-08-03 15:54:38 +03:00
if (function_exists('pinba_timer_start') && function_exists('pinba_timer_stop')) {
2019-12-26 17:47:33 +03:00
$timer = pinba_timer_start($tags);
$response = $handler();
pinba_timer_stop($timer);
} else {
$response = $handler();
}
return $response;
}
}