Getting rid of using timedelta.total_seconds() because of compatibility issues under Linux