Cody

# Problem 326. Tricky timing

Solution 419642

Submitted on 18 Mar 2014 by James
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
%% tic; y=foo(1); t2=toc assert((t2>.5)&&(t2<.6))

Elapsed time is 0.000472 seconds. Elapsed time is 0.000545 seconds. Elapsed time is 0.000578 seconds. Elapsed time is 0.000598 seconds. Elapsed time is 0.000615 seconds. Elapsed time is 0.000631 seconds. Elapsed time is 0.000647 seconds. Elapsed time is 0.000663 seconds. Elapsed time is 0.000679 seconds. Elapsed time is 0.000694 seconds. Elapsed time is 0.000710 seconds. Elapsed time is 0.000726 seconds. Elapsed time is 0.000742 seconds. Elapsed time is 0.000758 seconds. Elapsed time is 0.000774 seconds. Elapsed time is 0.000790 seconds. Elapsed time is 0.000808 seconds. Elapsed time is 0.000825 seconds. Elapsed time is 0.000841 seconds. Elapsed time is 0.000857 seconds. Elapsed time is 0.000873 seconds. Elapsed time is 0.000888 seconds. Elapsed time is 0.000904 seconds. Elapsed time is 0.000920 seconds. Elapsed time is 0.000936 seconds. Elapsed time is 0.000951 seconds. Elapsed time is 0.000967 seconds. Elapsed time is 0.000982 seconds. Elapsed time is 0.000998 seconds. Elapsed time is 0.001014 seconds. Elapsed time is 0.001030 seconds. Elapsed time is 0.001048 seconds. Elapsed time is 0.001065 seconds. Elapsed time is 0.001081 seconds. Elapsed time is 0.001097 seconds. Elapsed time is 0.001113 seconds. Elapsed time is 0.001129 seconds. Elapsed time is 0.001144 seconds. Elapsed time is 0.001160 seconds. Elapsed time is 0.001176 seconds. Elapsed time is 0.001191 seconds. Elapsed time is 0.001207 seconds. Elapsed time is 0.001223 seconds. Elapsed time is 0.001239 seconds. Elapsed time is 0.001254 seconds. Elapsed time is 0.001270 seconds. Elapsed time is 0.001286 seconds. Elapsed time is 0.001309 seconds. Elapsed time is 0.001338 seconds. Elapsed time is 0.001357 seconds. Elapsed time is 0.001373 seconds. Elapsed time is 0.001389 seconds. Elapsed time is 0.001405 seconds. Elapsed time is 0.001420 seconds. Elapsed time is 0.001436 seconds. Elapsed time is 0.001451 seconds. Elapsed time is 0.001467 seconds. Elapsed time is 0.001483 seconds. Elapsed time is 0.001498 seconds. Elapsed time is 0.001514 seconds. Elapsed time is 0.001530 seconds. Elapsed time is 0.001546 seconds. Elapsed time is 0.001562 seconds. Elapsed time is 0.001578 seconds. Elapsed time is 0.001593 seconds. Elapsed time is 0.001609 seconds. Elapsed time is 0.001625 seconds. Elapsed time is 0.001640 seconds. Elapsed time is 0.001656 seconds. Elapsed time is 0.001672 seconds. Elapsed time is 0.001687 seconds. Elapsed time is 0.001703 seconds. Elapsed time is 0.001718 seconds. Elapsed time is 0.001734 seconds. Elapsed time is 0.001750 seconds. Elapsed time is 0.001765 seconds. Elapsed time is 0.001781 seconds. Elapsed time is 0.001797 seconds. Elapsed time is 0.001812 seconds. Elapsed time is 0.001828 seconds. Elapsed time is 0.001843 seconds. Elapsed time is 0.001859 seconds. Elapsed time is 0.001874 seconds. Elapsed time is 0.001890 seconds. Elapsed time is 0.001906 seconds. Elapsed time is 0.001922 seconds. Elapsed time is 0.001937 seconds. Elapsed time is 0.001954 seconds. Elapsed time is 0.001969 seconds. Elapsed time is 0.001985 seconds. Elapsed time is 0.002000 seconds. Elapsed time is 0.002016 seconds. Elapsed time is 0.002031 seconds. Elapsed time is 0.002047 seconds. Elapsed time is 0.002063 seconds. Elapsed time is 0.002078 seconds. Elapsed time is 0.002094 seconds. Elapsed time is 0.002109 seconds. Elapsed time is 0.002125 seconds. Elapsed time is 0.002141 seconds. Elapsed time is 0.002170 seconds. Elapsed time is 0.002187 seconds. Elapsed time is 0.002203 seconds. Elapsed time is 0.002219 seconds. Elapsed time is 0.002235 seconds. Elapsed time is 0.002250 seconds. Elapsed time is 0.002266 seconds. Elapsed time is 0.002282 seconds. Elapsed time is 0.002298 seconds. Elapsed time is 0.002314 seconds. Elapsed time is 0.002330 seconds. Elapsed time is 0.002346 seconds. Elapsed time is 0.002362 seconds. Elapsed time is 0.002378 seconds. Elapsed time is 0.002394 seconds. Elapsed time is 0.002409 seconds. Elapsed time is 0.002433 seconds. Elapsed time is 0.002464 seconds. Elapsed time is 0.002492 seconds. Elapsed time is 0.002510 seconds. Elapsed time is 0.002529 seconds. Elapsed time is 0.002548 seconds. Elapsed time is 0.002564 seconds. Elapsed time is 0.002580 seconds. Elapsed time is 0.002596 seconds. Elapsed time is 0.002612 seconds. Elapsed time is 0.002627 seconds. Elapsed time is 0.002643 seconds. Elapsed time is 0.002659 seconds. Elapsed time is 0.002674 seconds. Elapsed time is 0.002690 seconds. Elapsed time is 0.002705 seconds. Elapsed time is 0.002721 seconds. Elapsed time is 0.002736 seconds. Elapsed time is 0.002752 seconds. Elapsed time is 0.002768 seconds. Elapsed time is 0.002784 seconds. Elapsed time is 0.002800 seconds. Elapsed time is 0.002816 seconds. Elapsed time is 0.002832 seconds. Elapsed time is 0.002848 seconds. Elapsed time is 0.002863 seconds. Elapsed time is 0.002879 seconds. Elapsed time is 0.002895 seconds. Elapsed time is 0.002911 seconds. Elapsed time is 0.002927 seconds. Elapsed time is 0.002943 seconds. Elapsed time is 0.002959 seconds. Elapsed time is 0.002975 seconds. Elapsed time is 0.002990 seconds. Elapsed time is 0.003006 seconds. Elapsed time is 0.003022 seconds. Elapsed time is 0.003038 seconds. Elapsed time is 0.003054 seconds. Elapsed time is 0.003069 seconds. Elapsed time is 0.003085 seconds. Elapsed time is 0.003101 seconds. Elapsed time is 0.003117 seconds. Elapsed time is 0.003132 seconds. Elapsed time is 0.003148 seconds. Elapsed time is 0.003164 seconds. Elapsed time is 0.003180 seconds. Elapsed time is 0.003196 seconds. Elapsed time is 0.003212 seconds. Elapsed time is 0.003227 seconds. Elapsed time is 0.003243 seconds. Elapsed time is 0.003258 seconds. Elapsed time is 0.003274 seconds. Elapsed time is 0.003290 seconds. Elapsed time is 0.003306 seconds. Elapsed time is 0.003321 seconds. Elapsed time is 0.003337 seconds. Elapsed time is 0.003353 seconds. Elapsed time is 0.003369 seconds. Elapsed time is 0.003384 seconds. Elapsed time is 0.003400 seconds. Elapsed time is 0.003415 seconds. Elapsed time is 0.003430 seconds. Elapsed time is 0.003446 seconds. Elapsed time is 0.003462 seconds. Elapsed time is 0.003478 seconds. Elapsed time is 0.003494 seconds. Elapsed time is 0.003509 seconds. Elapsed time is 0.003525 seconds. Elapsed time is 0.003541 seconds. Elapsed time is 0.003557 seconds. Elapsed time is 0.003579 seconds. Elapsed time is 0.003607 seconds. Elapsed time is 0.003627 seconds. Elapsed time is 0.003643 seconds. Elapsed time is 0.003659 seconds. Elapsed time is 0.003675 seconds. Elapsed time is 0.003690 seconds. Elapsed time is 0.003706 seconds. Elapsed time is 0.003722 seconds. Elapsed time is 0.003738 seconds. Elapsed time is 0.003754 seconds. Elapsed time is 0.003769 seconds. Elapsed time is 0.003785 seconds. Elapsed time is 0.003803 seconds. Elapsed time is 0.003819 seconds. Elapsed time is 0.003835 seconds. Elapsed time is 0.003851 seconds. Elapsed time is 0.003867 seconds. Elapsed time is 0.003882 seconds. Elapsed time is 0.003898 seconds. Elapsed time is 0.003914 seconds. Elapsed time is 0.003929 seconds. Elapsed time is 0.003945 seconds. Elapsed time is 0.003960 seconds. Elapsed time is 0.003976 seconds. Elapsed time is 0.003992 seconds. Elapsed time is 0.004007 seconds. Elapsed time is 0.004023 seconds. Elapsed time is 0.004039 seconds. Elapsed time is 0.004055 seconds. Elapsed time is 0.004070 seconds. Elapsed time is 0.004086 seconds. Elapsed time is 0.004102 seconds. Elapsed time is 0.004117 seconds. Elapsed time is 0.004133 seconds. Elapsed time is 0.004149 seconds. Elapsed time is 0.004164 seconds. Elapsed time is 0.004179 seconds. Elapsed time is 0.004195 seconds. Elapsed time is 0.004211 seconds. Elapsed time is 0.004227 seconds. Elapsed time is 0.004242 seconds. Elapsed time is 0.004258 seconds. Elapsed time is 0.004274 seconds. Elapsed time is 0.004289 seconds. Elapsed time is 0.004305 seconds. Elapsed time is 0.004320 seconds. Elapsed time is 0.004336 seconds. Elapsed time is 0.004352 seconds. Elapsed time is 0.004368 seconds. Elapsed time is 0.004384 seconds. Elapsed time is 0.004400 seconds. Elapsed time is 0.004416 seconds. Elapsed time is 0.004431 seconds. Elapsed time is 0.004447 seconds. Elapsed time is 0.004468 seconds. Elapsed time is 0.004486 seconds. Elapsed time is 0.004502 seconds. Elapsed time is 0.004518 seconds. Elapsed time is 0.004534 seconds. Elapsed time is 0.004550 seconds. Elapsed time is 0.004566 seconds. Elapsed time is 0.004582 seconds. Elapsed time is 0.004597 seconds. Elapsed time is 0.004613 seconds. Elapsed time is 0.004629 seconds. Elapsed time is 0.004644 seconds. Elapsed time is 0.004660 seconds. Elapsed time is 0.004676 seconds. Elapsed time is 0.004695 seconds. Elapsed time is 0.004725 seconds. Elapsed time is 0.004745 seconds. Elapsed time is 0.004762 seconds. Elapsed time is 0.004778 seconds. Elapsed time is 0.004794 seconds. Elapsed time is 0.004810 seconds. Elapsed time is 0.004825 seconds. Elapsed time is 0.004841 seconds. Elapsed time is 0.004857 seconds. Elapsed time is 0.004873 seconds. Elapsed time is 0.004888 seconds. Elapsed time is 0.004904 seconds. Elapsed time is 0.004920 seconds. Elapsed time is 0.004936 seconds. Elapsed time is 0.004952 seconds. Elapsed time is 0.004968 seconds. Elapsed time is 0.004983 seconds. Elapsed time is 0.004999 seconds. Elapsed time is 0.005014 seconds. Elapsed time is 0.005030 seconds. Elapsed time is 0.005046 seconds. Elapsed time is 0.005061 seconds. Elapsed time is 0.005077 seconds. Elapsed time is 0.005093 seconds. Elapsed time is 0.005108 seconds. Elapsed time is 0.005124 seconds. Elapsed time is 0.005140 seconds. Elapsed time is 0.005155 seconds. Elapsed time is 0.005172 seconds. Elapsed time is 0.005187 seconds. Elapsed time is 0.005203 seconds. Elapsed time is 0.005219 seconds. Elapsed time is 0.005234 seconds. Elapsed time is 0.005250 seconds. Elapsed time is 0.005266 seconds. Elapsed time is 0.005281 seconds. Elapsed time is 0.005297 seconds. Elapsed time is 0.005312 seconds. Elap...

### Community Treasure Hunt

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

Start Hunting!