The child exits, with sends a signal to the parent. This causes the sleep() to be interrupted. You may want to use a sleep that does sub second timings, and inspect the return value of sleep, sleeping again if necessary.
Comment on Re: fork() doesn't care about my sleep()?