How to measure an interval between messages.
-
You can use QElapsedTimer
-
@Christian-Ehrlicher said in How to measure an interval between messages.:
You can use QElapsedTimer
QElapsedTimer timer; timer.start();
When do I start it? On an application start? Should It be global to all files that uses it?
-
@jenya7 said in How to measure an interval between messages.:
When do I start it? On an application start? Should It be global to all files that uses it?
You start it when you want to start measuring your time - don't understand your question.
-
@Christian-Ehrlicher said in How to measure an interval between messages.:
@jenya7 said in How to measure an interval between messages.:
When do I start it? On an application start? Should It be global to all files that uses it?
You start it when you want to start measuring your time - don't understand your question.
It has to be a global time reference cause messages comes asynchronously and I have to take an interval between two the-same-kind messages.
-
@jenya7 said in How to measure an interval between messages.:
I have to take an interval between two the-same-kind messages.
Then create a QElapsedTimer per same message.
-
@Christian-Ehrlicher said in How to measure an interval between messages.:
@jenya7 said in How to measure an interval between messages.:
I have to take an interval between two the-same-kind messages.
Then create a QElapsedTimer per same message.
a local one? don't understand from examples - timer.start(); - it takes the current system time?
-
@jenya7 said in How to measure an interval between messages.:
What should I place as an argument at msecsTo? a previous time stamp?
Since you want to measure the interval between 2 messages, then the argument to
msecsTo()
should be the timestamp of the previous message. -
@JKSH said in How to measure an interval between messages.:
@jenya7 said in How to measure an interval between messages.:
What should I place as an argument at msecsTo? a previous time stamp?
Since you want to measure the interval between 2 messages, then the argument to
msecsTo()
should be the timestamp of the previous message.Thank you.
msecsTo() - is it absolute? I mean
previous timestamp = 23:50:00 (hh:ss:mm)
current timestamp = 00:10:00 (hh:ss:mm)
msecsTo() handles the case?