Created
February 1, 2013 15:15
-
-
Save alphaville/4691899 to your computer and use it in GitHub Desktop.
Measures the execution time of a MATLAB function (on average). Uses a fixed test time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| time_test = 4; % Time each test may last (in seconds) | |
| tic; | |
| t1=0; | |
| ntrials=0; | |
| while (t1<time_test) | |
| % Do things to be benchmarked | |
| ntrials=ntrials+1; | |
| t1=toc; | |
| end | |
| time_coder=t1/ntrials; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment