diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/time.m	Tue May 24 08:42:27 2016 +0200
@@ -0,0 +1,10 @@
+function t = time(f)
+    s = tic();
+
+    f();
+
+    if nargout == 1
+        t = toc(s);
+    else
+        toc(s);
+end
\ No newline at end of file