This inacuracy is a "feature" of all non-Real-Time operating systems. The error you cited is on the order of 40 ms. This is not bad. I have bench marked the timer functions on Windows platforms and found them to vary drastically when working in the sub second arena.
If you need determinism (the ability to specify when in time an event should occur) you will have to implement a hardware solution (i.e. configure some DAQ board to use its on-board clock to start and stop something) or move to an RT environment.
In LV-RT I have managed to pull off determistic loops with jitter less than 1 ms using timer functions, and sub-micro-second jitter using hardware timing.
Summing up.
Asking for 10 seconds and getting 10.04 is pretty good.
I hope this helps,
Ben