Return elapsed time - MATLAB Cody - MATLAB Central

Problem 1690. Return elapsed time

Difficulty:Rate

Write a function that returns the amount of time it takes to run the function, as measured by tic and toc. Your answer must be correct to within 5 milliseconds.

Basic template is:

tic
t = timetorun()
toc

Solution Stats

6.65% Correct | 93.35% Incorrect
Last Solution submitted on Sep 17, 2025

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers23

Suggested Problems

More from this Author44

Problem Tags

Community Treasure Hunt

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

Start Hunting!