I read some forum posts where you specify that you use QueryPerformanceCounter and QueryPerformanceFrequency to measure timestamps. I tried to do the same, but I get different timestamps. Which part am I doing wrong?
My code is:
send CAN frame and save current time point with code:
Code: Select all
LARGE_INTEGER EndingTime, ElapsedMicroseconds;
LARGE_INTEGER Frequency;
QueryPerformanceFrequency(&Frequency);
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = (EndingTime.QuadPart * 1000000) / Frequency.QuadPart;
cout << "time point: " << ElapsedMicroseconds.QuadPart << endl;
Code: Select all
r = pcan->Read(pcan->channel, &receivedMsg, ×tamp);
if (r == PCAN_ERROR_OK)
microsTimestamp = timestamp.micros + 1000 * timestamp.millis + 0x100000000 * 1000 * timestamp.millis_overflow;
cout << microsTimeStamp << endl;
Which is wrong, even from the number of digits. I hope you can help me.time point: 202831938021
968478406
