| | |
Time Difference with precision
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Solved Threads: 0
Hello,
Iam trying to calculate packet delay from server to client. Iam capturing the packets using WireShark and filtering them out on both sides to calculate the delay by computing difference between their timestamps.
In WireShark, I can get the timestamps in both Epoch & in HH: MM: SS format with nanosecond precision. The timestamps I read from the file are char array type
1. How can I convert strings to a time format which can be used to compute time difference with high precision ?
The difftime() function computes time difference in epoch units but with only seconds precision.
2. How can I computer time difference with high precision ? Is there any other method than difftime() ?
Thank you for your time!
shuaib
Iam trying to calculate packet delay from server to client. Iam capturing the packets using WireShark and filtering them out on both sides to calculate the delay by computing difference between their timestamps.
In WireShark, I can get the timestamps in both Epoch & in HH: MM: SS format with nanosecond precision. The timestamps I read from the file are char array type
1. How can I convert strings to a time format which can be used to compute time difference with high precision ?
The difftime() function computes time difference in epoch units but with only seconds precision.
2. How can I computer time difference with high precision ? Is there any other method than difftime() ?
Thank you for your time!
shuaib
Last edited by shuaibe; Jul 17th, 2007 at 6:21 am.
1. Just parse the string. If you already know the time format then it is not very difficult to split the string into its individual parts (hours, minutes, seconds, milliseconds).
2. The milliseconds is not very useful when the time difference is greater than probably one minute. If the difference is less than one minute then just convert both times to milliseconds and subtract them.
2. The milliseconds is not very useful when the time difference is greater than probably one minute. If the difference is less than one minute then just convert both times to milliseconds and subtract them.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Time difference (MS Access and FileMaker Pro)
- Calculating Time Difference (C++)
- time difference (Visual Basic 4 / 5 / 6)
- Elapsed time for retriving data from database (Visual Basic 4 / 5 / 6)
- Execution time (C)
Other Threads in the C Forum
- Previous Thread: How to correctly use the getuserattr and putuserattr in "C"
- Next Thread: help on turbo c: creating a truth table please..
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches include infiniteloop initialization input intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test threads unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






