Skip to content

Commit

Permalink
Added comment (#6607)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyanwow authored Mar 20, 2024
1 parent ce27c2a commit f160712
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static function put(string $name, float $sample, ?array $labels = [])

public static function time(string $name, callable $func, ?array $args = [], ?array $labels = [])
{
// Must be keep the variable $timer alive, otherwise the destructor will be called right now.
$timer = new Timer($name, $labels);
return $func(...$args);
}
Expand Down

0 comments on commit f160712

Please sign in to comment.