How do I start a function at the exact computer clock time?
1 view (last 30 days)
Adam Danz on 15 Nov 2021
Edited: Adam Danz on 17 Nov 2021
> How do I start a function at the exact computer clock time?
It depends on how you define "exact" and "start".
If "start" means to evoke the function and if "exact" allows for several ms lag, you could use a timer to continually check the clock time at regular intervals and evoke the function as soon as the specified time is detected.
The minimum interval is 0.001 sec (1 ms) but you should expected small delays associated with runtime of the timer and other internal processing required to call your function. If Matlab is busy processing another task when the target clock time arrives, there could be additional delays.