Skip to content

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

@ghost

Description

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions