22declare(strict_types=1);
38 private int $notificationProcessingTimeNs = 0;
44 private static array $handlerTimings = [];
46 public function __construct(
49 parent::__construct();
53 $name =
Utils::getNiceClosureName($handler);
54 $timings = self::$handlerTimings[$name] ??=
new TimingsHandler(
"Snooze Handler: " . $name, $this->timings);
56 return parent::addNotifier(
function() use ($timings, $handler) :
void{
57 $timings->startTiming();
59 $timings->stopTiming();
74 $startTime = hrtime(true);
75 $this->timings->startTiming();
77 parent::processNotifications();
79 $this->notificationProcessingTimeNs += hrtime(
true) - $startTime;
80 $this->timings->stopTiming();
addNotifier(\Closure $handler)
resetNotificationProcessingTime()
getNotificationProcessingTime()