In Java, we can use System.currentTimeMillis() to get the current timestamp in milliseconds from a point in time that is -
the difference, in milliseconds, between the current time and midnight, January 1, 1970 UTC.
In C ++, how to get the same thing?
I am currently using this to get the current timestamp -
struct timeval tp; gettimeofday(&tp, NULL); long int ms = tp.tv_sec * 1000 + tp.tv_usec / 1000;
Does it look right or not?
c ++ timestamp
AKIWEB Oct 24 '13 at 1:08 2013-10-24 01:08
source share