8000 [Process] Add getter for process starttime · symfony/symfony@3b9ed3e · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b9ed3e

Browse files
dompienicolas-grekas
authored andcommitted
[Process] Add getter for process starttime
1 parent 8c694d6 commit 3b9ed3e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Symfony/Component/Process/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
5.1.0
5+
-----
6+
7+
* added `Process::getStartTime()` to retrieve the start time of the process as float
8+
49
5.0.0
510
-----
611

src/Symfony/Component/Process/Process.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,18 @@ public function checkTimeout()
12081208
}
12091209
}
12101210

1211+
/**
1212+
* @throws LogicException in case process is not started
1213+
*/
1214+
public function getStartTime(): float
1215+
{
1216+
if (!$this->isStarted()) {
1217+
throw new LogicException('Start time is only available after process start.');
1218+
}
1219+
1220+
return $this->starttime;
1221+
}
1222+
12111223
/**
12121224
* Returns whether TTY is supported on the current operating system.
12131225
*/

0 commit comments

Comments
 (0)
0