File: utils.py

package info (click to toggle)
testrepository 0.0.20-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 752 kB
  • sloc: python: 5,871; sh: 37; makefile: 27
file content (7 lines) | stat: -rw-r--r-- 237 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7

def timedelta_to_seconds(delta):
    """Return the number of seconds that make up the duration of a timedelta.
    """
    return (
        (delta.microseconds + (delta.seconds + delta.days * 24 * 3600) * 10**6)
        / float(10**6))