Skip to content

Commit 975e1c5

Browse files
committed
Single timing helper
1 parent ed8e6e2 commit 975e1c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Headers/ServerTiming.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ class ServerTiming implements Header
55
{
66
protected $_timings = [];
77

8+
public static function single($key, $duration, $description = "")
9+
{
10+
$h = new static();
11+
$h->add($key, $duration, $description);
12+
return $h;
13+
}
14+
815
public function add($key, $duration, $description = "")
916
{
1017
$this->_timings[$key] = "$key"

0 commit comments

Comments
 (0)