|Anand BVKS: how do i allow it sleep for a fractional number in microseconds|
1000 nanoseconds = 1 millisecond.
But on PC's, as StuartS says, be careful of sleep. Every function of sleep should be very specific about what it guarantees.
For instance, Win32's Sleep() guarantees to mark the thread unrunnable for at least the specified interval, ± 1 CPU tick.
POSIX usleep() guarantees to keep the thread from running for at least the specified interval, as long as certain signals are not sent to it.
Java's Thread.sleep() won't even give you that much. Java doesn't guarantees the same "at least" mechanics as the previous two. A thread might even wake up early.
(For reference, .NET's Thread.Sleep() just calls Win32's SleepEx().)