You should calculate your sleep time, rather than using a fixed time.
something like:
t1=get_tick_count()
shoot()
sleep(2000 - (get_tick_count() - t1)
If you are relying on autofocus on a variable scene, you may need to make additional adjustments to account for variation in AF time. With fixed focus, the above should be able to give you consistent intervals to within tens of milliseconds.
Of course, your interval also has to be longer than the maximum time the actual shot will take.