It depends on the platform. Unix/Linux and Windows-based operating systems have different sleep functions.
Check this out for C sleep.
For C++, see this post.