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).


Updated 18 Feb 2022

View License

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 (2023). 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 .

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes