handystats icon indicating copy to clipboard operation
handystats copied to clipboard

STL conformance

Open binnacle opened this issue 6 years ago • 2 comments

Thank you for the excellent software, is handy indeed!

I noticed the handystats::chrono interface is a bit out-of-sync with std::chrono. Has any thought been applied toward bringing them into alignment?

binnacle avatar Oct 10 '18 18:10 binnacle

Some clarification: Just spent a couple of days with Handystats and in particular it is fantastic for instrumenting code with TSC delta measurements. The library is considerably faster than the GCC 8.2.0 STL implementation, evident when HANDY_CLOCK_SOURCE=CLOCK_MONOTONIC is compared.

My thought is not to change the implementation in any major way but add a few elements that might render it a drop-in alternative to the STL in common use cases. In particular support for duration_cast<duration<typename, ratio<>>> conversion (for time insensitive report display), member types such as ::timePoint ::duration, and constructors accepting compatible initial values would obviate the requirement for #ifdef's in many situations.

binnacle avatar Oct 14 '18 23:10 binnacle

Hi, I'm glad you found the library useful!

Yeah, unfortunately, handystats' chrono interface wasn't updated to conform to std::chrono. Actually, we didn't consider this as a feature. But it would be great if handystats' chrono can be more STL-compliant.

It would be great if you could submit a PR with required changes! Or you could help us and structure the issue with a list of required changes to be made.

Thanks anyway!

shindo avatar Oct 16 '18 20:10 shindo