MATLAB: Timer Objects — execution frequency limits

frequencyinterrupt latencylimitedperiodtimer object

Hi,
I am trying to use a Timer object to make an API call to an external library every so often (~fractions of a second).
t = timer;
set(t,'ExecutionMode','fixedDelay','BusyMode','drop','Period',0.005);
t.TimerFcn = @my_callback_fcn;
While I don't need precise control over the instantaneous period, and I am ok with executions getting dropped once in a while, I need the average period to be around 5 milliseconds (specified above).
However, when I run the above timer on my Matlab R2009b (on Win XP sp2) with a dummy callback (nothing inside my_callback_fcn), it takes at least ~16 ms between successive timer executions i.e. the frequency of calling TimerFcn is about 60Hz.
Is the timer period something I can reduce to a value smaller than 16ms? Or is this a system limited value?
I would appreciate some feedback.
Thanks,
Sridhar

Best Answer

There is not hard limit in the timer frequency. The system speed limits the execution time of the callbacks and in consequence the frequency.
You could by a faster computer. In the comparisons I've seen in the net, Matlab runs remarkably faster under Linux.