8000 feature #35673 [Process] Add getter for process starttime (dompie) · symfony/symfony@f46ab58 · GitHub
[go: up one dir, main page]

Skip to content

Commit f46ab58

Browse files
feature #35673 [Process] Add getter for process starttime (dompie)
This PR was squashed before being merged into the 5.1-dev branch. Discussion ---------- [Process] Add getter for process starttime | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | issue #35531 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Add a getter for process start time. Commits ------- 3b9ed3e [Process] Add getter for process starttime
2 parents 0f46aa6 + 3b9ed3e commit f46ab58

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