class StopwatchPeriod in Devel 4.x
Same name and namespace in other branches
- 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchPeriod
- 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchPeriod
- 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchPeriod
Class StopwatchPeriod.
Hierarchy
- class \Drupal\webprofiler\StopwatchPeriod
Expanded class hierarchy of StopwatchPeriod
File
- webprofiler/
src/ Stopwatch.php, line 548
Namespace
Drupal\webprofilerView source
class StopwatchPeriod {
private $start;
private $end;
private $memory;
/**
* Constructor.
*
* @param int $start
* The relative time of the start of the period (in milliseconds)
* @param int $end
* The relative time of the end of the period (in milliseconds)
*/
public function __construct($start, $end) {
$this->start = (int) $start;
$this->end = (int) $end;
$this->memory = memory_get_usage(TRUE);
}
/**
* Gets the relative time of the start of the period.
*
* @return int
* The time (in milliseconds).
*/
public function getStartTime() {
return $this->start;
}
/**
* Gets the relative time of the end of the period.
*
* @return int
* The time (in milliseconds).
*/
public function getEndTime() {
return $this->end;
}
/**
* Gets the time spent in this period.
*
* @return int
* The period duration (in milliseconds).
*/
public function getDuration() {
return $this->end - $this->start;
}
/**
* Gets the memory usage.
*
* @return int
* The memory usage (in bytes).
*/
public function getMemory() {
return $this->memory;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StopwatchPeriod:: |
private | property | ||
StopwatchPeriod:: |
private | property | ||
StopwatchPeriod:: |
private | property | ||
StopwatchPeriod:: |
public | function | Gets the time spent in this period. | |
StopwatchPeriod:: |
public | function | Gets the relative time of the end of the period. | |
StopwatchPeriod:: |
public | function | Gets the memory usage. | |
StopwatchPeriod:: |
public | function | Gets the relative time of the start of the period. | |
StopwatchPeriod:: |
public | function | Constructor. |