Timer Functions in MATLAB: tic and toc functions

Track time it takes to run some code. You can also track time it takes your user to interact with your code like this example (math quiz).

https://www.youtube.com/c/EngineeringwithDrKelseyJoy

You are now following this Submission

This code is explained in the following YouTube Video: https://youtu.be/c0nJWZp4SoU
For more of my YouTube Videos, check out my MATLAB tutorial playlist: https://youtube.com/playlist?list=PLmB_c16LoAcWz_5qK1XpBlP0DiD6cgU-r
Also subscribe to my channel (Engineering with Dr. Kelsey Joy): https://www.youtube.com/c/EngineeringwithDrKelseyJoy

Cite As

Dr. Kelsey Joy (2026). Timer Functions in MATLAB: tic and toc functions (https://www.mathworks.com/matlabcentral/fileexchange/106940-timer-functions-in-matlab-tic-and-toc-functions), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

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