Why use select() instead of sleep()?
Using select()
with NULL
rfds
, wfds
and efds
is an idiomatic way of portably sleeping with subsecond resolution.
Select allow for accurate sub second wait, and is more portable than sleep. There are other ways to wait, see this question.
But the timeout parameter of select should not be a float but a pointer to struct timeval. I'm surprised the code you show even compiles. More : this strange conditional select is followed by an unconditional sleep(1). Looks pointless to me.