def total_seconds(td):
"""
Given a timedelta (*td*) return an integer representing the equivalent of
Python 2.7's :meth:`datetime.timdelta.total_seconds`.
"""
return (((
td.microseconds +
(td.seconds + td.days * 24 * 3600) * 10**6) / 10**6))
# NOTE: This is something I'm investigating as a way to use the new go_async
# module. A work-in-progress. Ignore for now...
评论列表
文章目录