@classmethod
def from_timedelta(cls, delta):
    """
        Returns the closest pointwidth for the given timedelta without going over the
        specified duration. Because pointwidths are in powers of 2, be sure to check
        that the returned real duration is sufficient.
        """
    return cls.from_nanoseconds(delta.total_seconds() * 1000000000.0)
