I'm releasing a product soon, and I'd like for it to be availabe on Mac computers as well as Windows. However I don't know any code that does the same function as Sleep() that isn't Windows specific? Would you help me out?
EDIT: They won't necessarily work on Windows though. At least, not without some sort of workaround. I'd suggest using #ifs to check which platform you're compiling for, like:
1 2 3 4 5 6 7 8
#if defined(_WIN32)
//Windows code here.
#elif defined(__APPLE__) & defined(__MACH__)
//Mac code here.
#elif defined (__linux__)
//Linux code here, should you choose to use it. If not, delete the last #elif.
//sleep/usleep/nanosleep should also work on this platform.
#endif
Alright. What I'll do is I'll have the Windows version that's already made, then a mac / linux version with one of the functions supplied here, problably nanosleep. Thanks a ton guys.