Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » time measurement :: RTIMING, TimeStop, GetTickCount
time measurement :: RTIMING, TimeStop, GetTickCount [message #36180] Wed, 09 May 2012 12:17 Go to previous message
Wolfgang is currently offline  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:
Time lastPingRequest;


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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Search for constant and show it....
Next Topic: How do I 'check' a Switch control
Goto Forum:
  


Current Time: Sun Jun 09 22:15:32 CEST 2024

Total time taken to generate the page: 0.01736 seconds