If both signal are the same, one can measure the time

of zero crossing.

What I mean by the same is that they are sine/cosine,square, triangular or such,

of the same frequency.

You can not measure the phase difference between two signals such as a sine

and a triangular unless the zero crossings have some meaning.

For measuring power factor, see my post 23 ( corrections on earlier posts ).

This works with any shape of wave form.

Real life power does not have current that follows a sine or cosine wave.

That only works with things that have a fixed impedance, regardless of voltage.

If you just need phase angle, you use two zero cross detectors and one of the

timer modes.

One can do a search for zero cross detection on the forum. I'm sure you'll find

examples.

If you are making a power factor meter, for real world applications, it is not

just a phase difference.

Dwight