Takes a distributed job or task and computes the duration from create time to finish time. If the job or task has not finished, it calculates to the current time. For example:
time = duration(job);
Although this was tested with R2008a and the MathWorks Job Manager, it ought to work with past releases and other schedulers.