I have one line of code in the application server code that gets the timestamp value using steady_clock , as shown below:
uint64_t now = duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count();
Now we have two systems machineA, which runs Ubuntu 12 (gcc 4.6.3 compiler) and machineB, which runs Ubuntu 14 (gcc 4.8.2 compiler) .
Now we compile our application server code using make on another Ubuntu 12 VM (which has 4.7.3 compiler) , and then copy the tar file that is generated on machineA and start our application server. After starting, the above line of code outputs a value similar to this in machineA:
1439944652967
Now we also compile the same application server code using make on another Ubuntu 14 VM (which has 4.8.2 compiler) , and then copy the tar file that will be generated on machineB and start our application server. After starting, the above line of code outputs a value similar to this in machineB:
10011360
Do you see the difference right? I am confused, why is it a difference, I canโt understand it? All the code and everything is the same. Does anyone have an explanation about this and how can I fix this?
If necessary, I can try to add debugging code to understand what is wrong to understand this problem.
c ++ gcc ubuntu chrono
user1950349
source share