I hope that you're not using the Windoze environment. Millisecond timing in Windoze if difficult to maintain. With all of the background tasks running and Windoze almost attempt at multitasking, time intervals can be very inconsistent.
I would also say to watch what frequencies that you are looking for. At 1ms a 500Hz tone is only half a cycle. Most frequency measuring algorithms, measure to the same point on the next cycle, so at 1ms, frequencies below 1kHz are not measurable. You may have to adjust your timing.
That being said, have fun.
Rob