add c code snippet for generating a more accurate sleep function