Cody

Problem 1690. Return elapsed time

Solution 519635

Submitted on 3 Nov 2014 by Binbin Qi
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% timetorun(); t0 = tic; pause(1) t1 = timetorun(); t2 = toc(t0)-(t1+1); assert(abs(t2)<5e-3)

ans = @evalin

2   Pass
%% t0 = tic; pause(1) t1 = timetorun(); t2 = toc(t0)-(t1+1); assert(abs(t2)<5e-3)

ans = @evalin

3   Pass
%% t0 = tic; pause(1) t1 = timetorun(); t2 = toc(t0)-(t1+1); assert(abs(t2)<5e-3)

ans = @evalin

4   Pass
%% t0 = tic; pause(1) t1 = timetorun(); t2 = toc(t0)-(t1+1); assert(abs(t2)<5e-3)

ans = @evalin

5   Pass
%% t0 = tic; pause(1) t1 = timetorun(); t2 = toc(t0)-(t1+1); assert(abs(t2)<5e-3)

ans = @evalin

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!