Mercurial > repos > public > sbplib
changeset 148:1f5f988e9682
Added functions for printing and timing tasks in a script.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 05 Apr 2016 11:26:04 +0200 |
parents | 03151dd46534 |
children | e8c5092d3f1b |
files | labelTask.m |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r 03151dd46534 -r 1f5f988e9682 labelTask.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/labelTask.m Tue Apr 05 11:26:04 2016 +0200 @@ -0,0 +1,12 @@ +function o = labelTask(in) + + switch class(in) + case 'char' + fprintf(in); + o = tic(); + case 'uint64' + o = toc(in); + fprintf(' - done %fs\n', o); + otherwise + error('Unknow input type: %s', class(in)) + end