In the traditional compressed sensing algorithms, the precision of the time delay estimation is closely related to the number of atoms in the dictionary. The bigger the atom number, the smaller the atomic interval becomes, thus the higher the accuracy of the time delay estimation will be. However, the bigger atom number leads to a higher calculation load. Considering the limited calculation capacity of on-board computer, in order to fast obtain high-accuracy time delay estimation value of the integrated pulsar profile of pulsar in the X-ray pulsar-based navigation, we propose a time delay estimation method based on two-level compression sensing. Compressed sensing mainly includes three parts:the dictionary, the measurement matrix, and the recovery algorithm. Among them, the dictionary size is one of the most important factors that affect the estimation accuracy of the compressed sensing. Aiming to solve the problem of the greater computational load with the increase of the atom number in the dictionary of compressed sensing while improving the accuracy of estimation, we combine the rough estimation with the precision estimation as a two-level dictionary. In the first level, the global phase estimation of the low-dimensional integrated pulsar profile is carried out by making use of the feature of the large atomic interval and the small atomic amount of the rough estimation dictionary. Specifically, first, construct a coarse estimation dictionary according to the low-dimensional standard pulsar profile. Then make dimension reduction sampling on the low-dimensional integrated pulsar profile by the rough estimation measurement matrix based on low-dimensional Hadamard matrix. Finally, use an orthogonal matching pursuit method to obtain the predictive estimation of delay value. In the second level, by taking advantage of the small atomic intervals and numbers of the precise estimation dictionary which are suitable for local estimation, the exact time delay estimation of the high dimensional integrated pulsar profile is performed. Specifically, the original position is first corrected by using the predictive estimation of time delay value, that is, shifting the initial high-dimensional integrated pulsar profile as the input signal of the second level. Then the precise estimation dictionary is constructed according to the partial signal of the length of the high dimension standard pulse profile, using the precise estimation measurement matrix sampling on high-dimensional integrated pulsar profile to obtain measurement value. Finally, the optimal matching position is obtained through the recovery algorithm, which is then combined with the predictive estimation of delay value to calculate the prcis time delay estimation value. Theoretical analysis and experimental results show that the quantity of data in the two level dictionary is two orders of magnitude smaller than in the traditional dictionary. The proposed method reduces the computational complexity greatly compared with traditional compression sensing method in the same time delay estimation accuracy. Therefore, this method has the advantages of high precision and small calculation load.