Hi all,

This weekend, I've been looking at our code that generates
timestamps in the Drizzle kernel. Specifically, the my_micro_time()
function in drizzled/my_getsystime.cc. This function is
called by Session::getCurrentTimestamp(), which in turn
is used to create our start and end timestamps in our
GPB Transaction message.

The value returned by the function is a single 64-bit value
that contains both the total seconds since epoch AND the
number of microseconds. So it basically does:

  newtime= (uint64_t)t.tv_sec * 1000000 + t.tv_usec;
  return newtime;

This looks like it will cover us WELL into the future.

There is also a my_getsystime() function that will return
a 64-bit number that includes nanoseconds if the system
supports it.

My question is, should we be using the nanosecond
version in Session::getCurrentTimestamp()?  Does anyone
have any concerns around using a single 64-bit number
rather than a 64-bit value for seconds AND a 32-bit value
for micro/nano seconds?

-Dave

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to