According to the OP's description of the problem: no, it wouldn't. For this would simply make the program sleep for that amount of seconds doing nothing else in the meantime - alarm as already pointed out is the way to go.
Of course I imagine that one could make that work too, e.g. by forking a copy of the program that would do the sleep and then communicate the timeout to the parent with some form of IPC. But that, if possible, would just be an exercise in byzantine programming... | [reply] |