ou are not the only one with this problem. Keep in mind that Linux is not real time system and whenever you call sleep() function there are other process executing on Edison in this delays your delay. I wanted to use sleep function in Python and in is so slow that delay was not needed, the time Edison needed to execute function was delay enough. This can work in your benefit.
There are some workarounds, but it depends on your use case.