Home » Community » Newbie corner » time measurement :: RTIMING, TimeStop, GetTickCount
time measurement :: RTIMING, TimeStop, GetTickCount [message #36180] |
Wed, 09 May 2012 12:17 |
Wolfgang
Messages: 146 Registered: November 2011 Location: Germany
|
Experienced Member |
|
|
I want to know how long (in ms) it takes to get a response from my server through a udp connection. (from a ping)
header:
send method:
bool hcan::doSend(uint16 what, CanFrame& frame)
{
if (!service.prepFrame(what, frame))
return false;
if (what == CanMethod::PING_REQUEST)
lastPingRequest = GetSysTime();
if (urc.RawSend(frame))
...
}
receive method:
case CanMethod::PING_REPLAY:
{
int64 pingLatency = GetSysTime() - ToTime(lastPingRequest);
String tLogMsg = "Ping latency: ";
tLogMsg << AsString(pingLatency);
Log(2,tLogMsg);
}
But this returns me something like:
Ping latency: 43909
Ping latency: 44138
I think I have more than one fault in my try to get the time... but I found nothing that I could understand to RTIMING etc.
Can someone give me a small example how to do?
[Updated on: Wed, 09 May 2012 12:18] Report message to a moderator
|
|
|
|
|
time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
By: Didier on Wed, 09 May 2012 22:23
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
|
|
Re: time measurement :: RTIMING, TimeStop, GetTickCount
|
Goto Forum:
Current Time: Sun Jun 09 22:15:32 CEST 2024
Total time taken to generate the page: 0.01736 seconds
|