Closed
Description
Description
Currently, when you do:
$stopwatch->start('foo');
$event = $stopwatch->stop('foo');
echo (string) $event;
... you're not getting the event's name "foo" in the output:
default: 16.00 MiB - 0 ms
"default" is the category
of the event, and since we didn't provide one, it defaults to "default". This is a little weird.
So I'm suggesting:
- Add the
$name
property to StopwatchEvent and display the(string)
output in the form "category: name", withcategory
defaulting to''
. So in our example the output would be:foo: 16.00 MiB - 0 ms
OR
- Rename
$category
to$label
(to signify that this is not meant to "categorize" anything, but merely the string you will see again in the output), and$name
to$id
(to signify that this is just an internal ID you won't see again)