In a recent code review, the following snippet was called out as reinventing thewheel:_MICROSECONDS_PER_SECOND = 1000000def _timedelta_to_microseconds(delta):return int(delta.total_seconds() * _MICROSECONDS_PER_SECOND)The reviewer thought that there must already exist a standard library functionthat fulfills this functionality. After we had both satisfied ourselves that wehadn't simply missed something in the documentation, we decided that we hadbetter raise the issue with a wider audience.