Calculate the current timestamp if needed,
otherwise return the last cached one.

@return {string}
function getTimestamp() {
    // use `Math.floor()` here to avoid the "Unix Millennium Bug"
    var now = Math.floor(Date.now() / 1000)

    // it's another second since the last id were created,
    // so we need to regenerate the timestamp
    if (time !== now) {
        ctr       = 0
        timestamp = pad(time = now, 8, 16)
    }
    // Since changing parts of an identifier are the timestamp and
    // the sequence; the count of maximum allocatable ids in a second
    // is limited by the sequence size (3-bytes = about 16 million).
    // Otherwise uniqueness is not guaranteed.
    else
        assert(++ctr < 0x1000000, 'more than 16 million ids generated in 1 second')

    return timestamp
}