devster/ubench

[proposal] throw exceptions

Closed this issue · 3 comments

  1. throw exception if end() was called before start()
  2. throw exception if getTime(), getMemoryUsage(), getMemoryPeak() was called before, start() -> end()

This will be very useful when bench async code, like ReactPHP or Amp

Hi,
It can be a good idea, but for both memory methods you can use them when you want too. And I don't know how people use this lib :)

@devster I think we can release new version like 1.3 or 2.0 and say about API break
and about memory you are right

If you provide a PR I would be glad to make a version 2 with those changes:

  • throw exception if end() was called before start()
  • throw exception if getTime(), before, start() -> end()

What do you think?