class StopwatchPeriod in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchPeriod
- 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchPeriod
- 4.x 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 489
Namespace
Drupal\webprofilerView source
class StopwatchPeriod {
private $start;
private $end;
private $memory;
/**
* Constructor.
*
* @param integer $start The relative time of the start of the period (in milliseconds)
* @param integer $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 integer The time (in milliseconds)
*/
public function getStartTime() {
return $this->start;
}
/**
* Gets the relative time of the end of the period.
*
* @return integer The time (in milliseconds)
*/
public function getEndTime() {
return $this->end;
}
/**
* Gets the time spent in this period.
*
* @return integer The period duration (in milliseconds)
*/
public function getDuration() {
return $this->end - $this->start;
}
/**
* Gets the memory usage.
*
* @return integer 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. |