[Process] Add getter for process starttime
This commit is contained in:
parent
8c694d6157
commit
3b9ed3e378
|
@ -1,6 +1,11 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
5.1.0
|
||||
-----
|
||||
|
||||
* added `Process::getStartTime()` to retrieve the start time of the process as float
|
||||
|
||||
5.0.0
|
||||
-----
|
||||
|
||||
|
|
|
@ -1208,6 +1208,18 @@ class Process implements \IteratorAggregate
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws LogicException in case process is not started
|
||||
*/
|
||||
public function getStartTime(): float
|
||||
{
|
||||
if (!$this->isStarted()) {
|
||||
throw new LogicException('Start time is only available after process start.');
|
||||
}
|
||||
|
||||
return $this->starttime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether TTY is supported on the current operating system.
|
||||
*/
|
||||
|
|
Reference in New Issue