Skip to content

Commit

Permalink
Update Timer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sagittaracc committed Mar 29, 2024
1 parent cd02f9e commit 860fd5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/decorators/Timer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#[Attribute]
final class Timer extends PythonDecorator
{
public function wrapper($func)
public function wrapper(callable $callback, array $args)
{
$time_start = microtime(true);

$result = $func();
$result = call_user_func_array($callback, $args);

$time_end = microtime(true);
$execution_time = $time_end - $time_start;

return "Total execution: $execution_time; Result: $result";
}
}
}

0 comments on commit 860fd5a

Please sign in to comment.