With the code above you'll only get a 1/2 ms delay...
http://www.picbasic.co.uk/forum/showthread.php?t=558