Wrap a callback in order to time asynchronous operations.