Implemented duration calculation for getData-method.