The C clock() function just returns me a zero. I tried using different types, with no improvement... Is this a good way to measure time with good precision?
clock()
clock() reports CPU time used. sleep() doesn't use any CPU time. So your result is probably exactly correct, just not what you want.
sleep()