this is more a generell C++ beginner Question:
I have 2 classes:
- Class A, including a 'ReadData' Method, which is called as soon as new Data is received by a TCP Socket
- Class B, including a Method 'Start' which is sending big amounts of data via TCP.
Due to the architecture, its not possible to have both methods in one class.
What I want to do:
- Start a Timer as soon as 'Start' in Class B is invoked.
- Stopp the Timer as soon as the 'ReadData'in Class A is invoked.
- Then i will calc the difference to see how long it took...
My Question:
Where do I create the Object:
QTimer transferTimer;
How can I pass the Object to my both Classes?
How is the proper way in C++ to handle this?
Thank you.