Possible Duplicate:
Sleep Less Than One Millisecond
How can I make a program sleep for a nanosecond? I searched the Internet, and I found several ways to sleep, but:
windows.h's Sleep()
sleeps only for milliseconds.
ctime
's nanosleep()
is only for POSIX systems, and I'm using Windows.
I also tried this:
int usleep(long usec)
{
struct timeval tv;
tv.tv_sec = usec/1000000L;
tv.tv_usec = usec%1000000L;
return select(0, 0, 0, 0, &tv);
};
But Code::Blocks says:
obj\Release\main.o:main.cpp|| undefined reference to `select@20'|
I tried many things, but everything failed. What should I do?