Delay Search of two signals
As long as the two signals are simply delayed versions of each  other the delay is simply given by the point in time where maximum of the cross correlation occurs. 

If the signals are uncorrelated, then the question is meaningless. 

The tricky part is when the two signals are partially correlated or are filtered versions of the same original signal. In this case you will first need to define what exactly you mean by "delay". One possible way to approach this would be to time shift the signals against each other, subtract them and sum the squares. The shift that results in the minimum energy in the difference would be considered the delay. Something like $d = min[sum((x(n)-y(n-d))^{2})]$