Use time.monotonic instead of time.time where appropriate (#31780)

This commit is contained in:
Ville Skyttä 2020-02-13 23:57:07 +02:00 committed by GitHub
parent fbbb29a6ec
commit 3018e8ff47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 23 deletions

View file

@ -4,7 +4,7 @@ import logging
import logging.handlers
import os
import sys
from time import time
from time import monotonic
from typing import Any, Dict, Optional, Set
import voluptuous as vol
@ -110,7 +110,7 @@ async def async_from_config_dict(
Dynamically loads required components and its dependencies.
This method is a coroutine.
"""
start = time()
start = monotonic()
core_config = config.get(core.DOMAIN, {})
@ -131,7 +131,7 @@ async def async_from_config_dict(
await _async_set_up_integrations(hass, config)
stop = time()
stop = monotonic()
_LOGGER.info("Home Assistant initialized in %.2fs", stop - start)
if REQUIRED_NEXT_PYTHON_DATE and sys.version_info[:3] < REQUIRED_NEXT_PYTHON_VER: