Chris Jones <cjns1...@gmail.com> wrote: > I would imagine the linux implementation of the sleep() function does > not result in anything besides some system call or other?
Right. But any time you're worried about performance (or more generally, any sort of resource overuse), keep in mind these two cardinal rules: - The best opportunity for improvement is the part of the program that consumes the most time/memory/etc. - Finding the most expensive part of the program cannot be done reliably by reading/thinking about the program, even for very experienced programmers. Measurement is the only reliable way. Attempts to improve a program's resource usage often make the program harder to understand and maintain, so it's good to first make sure that the change you're making will have a significant impact on the overall system. "Premature optimization is the root of all evil." - Donald Knuth "Profile, don't speculate." - Danial Bernstein paul