When I was using an impedance bridge, I was always measuring the phase difference manually by moving two cursors. Here comes some automation with Python.
This is a test using sine and cosine functions with the same frequency but with different amplitude. The phase difference is measured to be 89.99deg by a curve fitting.
This is a real data example. The phase difference is now 42.30deg.