cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
select() sleep
select() sleep
Mar 18, 2011 at 2:12pm UTC
ultifinitus
(1446)
Soooo just read this in the fd_set(3) man page
Some code calls select() with all three sets empty, n zero, and a non-NULL timeout as a fairly portable way to sleep with subsecond precision.
I hadn't thought about it, but that seems like a good way to sleep on the three main systems!
On another note. I am disliking learning asynchronous sockets. Mostly because I'm failing =)
Mar 18, 2011 at 2:45pm UTC
closed account (
S6k9GNh0
)
I'd rather use Boost.Thread's sleep() function.
http://www.boost.org/doc/libs/1_46_1/doc/html/thread/thread_management.html#thread.thread_management.thread.sleep
Mar 18, 2011 at 2:58pm UTC
ultifinitus
(1446)
Ya boost does have some pretty awesome stuff.
Topic archived. No new replies allowed.