This document describes the current stable version of Kombu (5.0). For development docs, go here.

Source code for kombu.utils.time

"""Time Utilities."""
# flake8: noqa


__all__ = ('maybe_s_to_ms',)


[docs]def maybe_s_to_ms(v): # type: (Optional[Union[int, float]]) -> int """Convert seconds to milliseconds, but return None for None.""" return int(float(v) * 1000.0) if v is not None else v