In this paper, we consider a class of time-delay optimal control problem (TDOCP) with canonical equality and inequality constraints. By applying control parameterization method together with time-scaling transformation, a TDOCP can be readily solved by gradient-based optimization methods. The partial derivative of the cost as well as the constraint functions with respect to the decision variables are obtained by variational approach, which is inefficient when the discretization for the control function is relatively dense. For general optimal control problem without time-delay, co-state approach is an effective way to compute the gradients, however, when time-delay is involved in the dynamic system, the co-state system is not known. In this paper, we derive the co-state system for TDOCP to compute the gradients of the cost and constraints. Numerical results show that the computational efficiency is much higher when compared with the traditional variational approach.