view time.m @ 193:cb65c81d6c87

Added functions to easily time and profile a function.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 24 May 2016 08:42:27 +0200
parents
children 305d8bb366ce
line wrap: on
line source

function t = time(f)
    s = tic();

    f();

    if nargout == 1
        t = toc(s);
    else
        toc(s);
end