Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect measurements using Windows + mingwx86_64 with GNU/GCC compiler #15

Open
ghost opened this issue Mar 30, 2021 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Mar 30, 2021

Hello,

First of all I would like to thank you for sharing single header benchmark library for C, unfortunately there is very little or no benchmark tools like that. I do have one problem though. On Windows with GCC the measurements are incorrect, yet while using Linux and GNU compiler everything works like a charm.

Here is the sample output, please notice incorrect mean and confidence interval

Screenshot_1

I was able to fix it adding the correct define if defined(__linux__) || defined(__GNUC__) this would ensure that time.h is included as well as UBENCH_USE_CLOCKGETTIME gets defined to use clock_gettime.

image

And the output looks more or less correct except it breaks DO_NOTHING call
image

If you would like to reproduce the issue let me know, I may attach a sample repo. The only requirement would be to have mingw installed on Windows machine and CMake 3.0+

Thanks!

@sheredom
Copy link
Owner

sheredom commented Apr 5, 2021

I don't have that setup alas - but I'd happily accept a PR if you can fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant