没有找到c++, MingW, ctime, nanosleep()

C++, MingW, ctime, nanosleep() not found?

本文关键字:ctime nanosleep MingW c++      更新时间:2023-10-16

我只是想使用nanosleep(),但它似乎不在mingwctime:

#include <ctime> //this is what I need, isn't it?

如何在MingW上使用nanosleep ?谢谢。

遗憾的是,MinGW不提供nanosleep()。
MinGW只提供这个列表中的函数,这些函数在Microsoft API中。

在标准c++库中没有这样的函数(nanosleep)。它是POSIX专用函数,声明在<time.h>中,而不是在<ctime>中。你在窗户下面。Windows不是POSIX。如果你想使用POSIX库,你需要安装Cygwin.