In JRuby, Types::Time has millisecond precision. We require client timestamps to have microsecond precision to minimize clashes in C*. This generator keeps track of the last generated timestamp, and if the current-time is within the same millisecond as the last, it fills the microsecond portion of the new timestamp with the value of an incrementing counter.

For example, if the generator triggers twice at time 12345678000 (microsecond granularity, but ms precisions as shown by 0’s for the three least-significant digits), it’ll return 12345678000 and 12345678001.

Inherits

Object

Includes

Methods

next

Create a new timestamp, as a 64-bit integer.

Returns:
Type Details
Integer an integer representing a timestamp in microseconds.