1

I'm working in matlab and I need to get a very precise time measurement. The accuracy I need is at least 1ms (and preferably much better than that). It needs to be a timestamp and not just a duration measurement, because I need it for clock synchronization. Answers for python can also help.

For clarification - I know how to get the current time. My problem is with the accuracy. As far as I know, the "clock" function is not accurate enough.

  • No, the main problem here is the accuracy. I know how to get the current time. – Elisha Modelevsky Mar 12 '17 at 15:51
  • 2
    Why do you think clock is not accurate enough? If I run `t1 = clock; t2 = clock; etime(t2,t1)`, I get a difference of 0.036ms, which is less than requested. I know there may be a common time delay. – m7913d Mar 12 '17 at 20:48
  • What kind of measurements? Image Acquisition Toolbox supports accurate timestamps. See: [Acquire Analog Input Data and Timestamps](https://www.mathworks.com/help/daq/ref/startforeground.html#bt960af-4). The toolbox relies on the driver to get an accurate timestamp. In most cases, it's not possible to get accurate measurements within Matlab, because Matlab architecture is not Real-Time software. (Windows and Linux are also not Real-Time OS, so you usually need Driver priority). – Rotem Mar 12 '17 at 21:20

0 Answers0