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

It seems that ruapu has broken the std::chrono clock of mingw64 #94

Closed
TianZerL opened this issue Apr 19, 2024 · 2 comments
Closed

It seems that ruapu has broken the std::chrono clock of mingw64 #94

TianZerL opened this issue Apr 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@TianZerL
Copy link
Contributor

TianZerL commented Apr 19, 2024

使用mingw64 gcc13.2 (Windows 11),运行 ruapu_init() 后会让std::chrono无法正确计算时间,返回nan

mingw64 Clang也有问题, 详见godbolt


I'm using mingw64 with gcc 13.2 (Windows 11), and run ruapu_init() will make std::chrono clock return nan.

mingw64 with Clang also has this issue, example in godbolt


#include <chrono>
#include <cstdio>

#define RUAPU_IMPLEMENTATION
#include "ruapu.h"

struct Timer {
    std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now();
    ~Timer()
    {
        auto end = std::chrono::high_resolution_clock::now();
        std::chrono::duration<double, std::milli> duration = end - start;
        std::printf("Timer took %lfms\n", duration.count());
    }
};

int main()
{
    ruapu_init();
    {
        Timer timer{};
    }
    return 0;
}

image

@nihui nihui added the bug Something isn't working label Apr 19, 2024
@nihui
Copy link
Owner

nihui commented Apr 19, 2024

confirmed

@nihui
Copy link
Owner

nihui commented Apr 21, 2024

修好了,请测试下 #95

@nihui nihui closed this as completed in a256b24 Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants