Elgg  Version master
Go to the documentation of this file.
1 <?php
3 namespace Elgg\Traits\Debug;
5 use Elgg\Timer;
12 trait Profilable {
14  private Timer $timer;
22  public function setTimer(Timer $timer) {
23  $this->timer = $timer;
24  }
31  public function hasTimer(): bool {
32  return isset($this->timer);
33  }
43  protected function beginTimer(array $keys): void {
44  if (!$this->hasTimer()) {
45  return;
46  }
48  $this->timer->begin($keys);
49  }
59  protected function endTimer(array $keys): void {
60  if (!$this->hasTimer()) {
61  return;
62  }
64  $this->timer->end($keys);
65  }
66 }
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
Capture timing info for profiling.
Definition: Timer.php:10
Has a timer been set.
Definition: Profilable.php:31
Definition: access.php:31
Definition: pending.php:28
setTimer(Timer $timer)
Set a timer that should collect begin/end times for events.
Definition: Profilable.php:22
beginTimer(array $keys)
Start the timer (when enabled)
Definition: Profilable.php:43
endTimer(array $keys)
Ends the timer (when enabled)
Definition: Profilable.php:59