track
Method to record statistics about a task that has to be run. Note that the actual running is done inside the record method, but the result is passed through so that the whole process is transparent to the caller.
Return
the result of the task, so that it can be passed through to the caller
Parameters
f
the task to run