def entry_compare(x, y):
    """Comparison function for two StandardEntries.

    This function establishes a global order by sorting on the
    (timestamp, id) tuple.
    """
    assert x and y
    if x.timestamp == y.timestamp:
        return x.id - y.id
    else:
        return x.timestamp - y.timestamp