An incomplete example on how to store a timestamp based on the available code:
int prevTime = 0;
void someFunction()
{
if (PCANReadS == PCAN_ERROR_OK)
{
int diffTime = 0;
if (prevTime)
difftime = timestamp.millis - prevTime;
prevTime = timestamp.millis;
}
}
It would be better to use the same type as
timestamp
for the global variable. But I did not know the type.