High Accuracy Timer

High-resolution performance counter

You are now following this Submission

Uses the high-resolution performance counter to get the time which exceeds one microsecond accuracy.
time = hat;
% do some calculations
diff = hat - time;

Cite As

Ivo Houtzager (2026). High Accuracy Timer (https://www.mathworks.com/matlabcentral/fileexchange/16534-high-accuracy-timer), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Simulink Block for Real Time Execution

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.2.0.0

more thread safe
Added Linux support using the POSIX high-resolution performance counter

1.0.0.0